<table><tr><td style="">yurchor created this revision.<br />yurchor added a reviewer: Okular.<br />Herald added a project: Okular.<br />Herald added a subscriber: okular-devel.<br />yurchor requested review of this revision.
</td><a style="text-decoration: none; padding: 4px 8px; margin: 0 8px 8px; float: right; color: #464C5C; font-weight: bold; border-radius: 3px; background-color: #F7F7F9; background-image: linear-gradient(to bottom,#fff,#f1f0f1); display: inline-block; border: 1px solid rgba(71,87,120,.2);" href="https://phabricator.kde.org/D19542">View Revision</a></tr></table><br /><div><strong>REVISION SUMMARY</strong><div><p>The user can choose the blue or some dark color for annotation background and the black text is hardly visible on such backgrounds.</p>

<p>Example:<br />
<a href="https://phabricator.kde.org/F6659432" style="background-color: #e7e7e7;
          border-color: #e7e7e7;
          border-radius: 3px;
          padding: 0 4px;
          font-weight: bold;
          color: black;text-decoration: none;">F6659432: dummy.png</a></p>

<p>This patch tries to use the luminance of background to determine what color (white or black) should be used for the text.</p>

<p>I know that it's a silly thing to use the dark background for the black text but it seems that someone's gotta do it. ;)</p>

<p>Currently, you should type something in the pop-up note to make the text visible. I could not find the right place for the color change yet. The help in determining the entry point to change the color from the beginning will be much appreciated.</p>

<p>BUG: 405105</p></div></div><br /><div><strong>TEST PLAN</strong><div><ol class="remarkup-list">
<li class="remarkup-list-item">Create a pop-up note with the default (yellow) background (F6, click on the "Pop-up Note" button, click somewhere in the document).</li>
<li class="remarkup-list-item">Type something. The text should be black (light background).</li>
<li class="remarkup-list-item">Use "Settings -> Configure Okular..." in the main menu. Go to the "Annotations" page, choose "Pop-up Note", then press "Edit" and select the blue color.</li>
<li class="remarkup-list-item">Create a pop-up note with the new (blue) background.</li>
<li class="remarkup-list-item">Type something. The text should be white (dark background).</li>
</ol>

<p>Screenshot:<br />
<a href="https://phabricator.kde.org/F6659428" style="background-color: #e7e7e7;
          border-color: #e7e7e7;
          border-radius: 3px;
          padding: 0 4px;
          font-weight: bold;
          color: black;text-decoration: none;">F6659428: new.png</a></p>

<p>Test file (you should type something in the "blue" pop-up note window to see the text):<br />
<a href="https://phabricator.kde.org/F6659429" style="background-color: #e7e7e7;
          border-color: #e7e7e7;
          border-radius: 3px;
          padding: 0 4px;
          font-weight: bold;
          color: black;text-decoration: none;">F6659429: test.pdf</a></p></div></div><br /><div><strong>REPOSITORY</strong><div><div>R223 Okular</div></div></div><br /><div><strong>REVISION DETAIL</strong><div><a href="https://phabricator.kde.org/D19542">https://phabricator.kde.org/D19542</a></div></div><br /><div><strong>AFFECTED FILES</strong><div><div>ui/annotwindow.cpp</div></div></div><br /><div><strong>To: </strong>yurchor, Okular<br /><strong>Cc: </strong>okular-devel, tfella, ngraham, darcyshen, aacid<br /></div>