Review Request 113358: Improve detection of dark color schemes for highlighting

Juliano Ravasi jravasi+kde at gmail.com
Sun Oct 20 20:30:53 UTC 2013


-----------------------------------------------------------
This is an automatically generated e-mail. To reply, visit:
http://git.reviewboard.kde.org/r/113358/
-----------------------------------------------------------

(Updated Oct. 20, 2013, 8:30 p.m.)


Review request for KDevelop.


Changes
-------

Add screenshot showing the before/after the change.


Repository: kdevplatform


Description
-------

When blending syntax highlighting colors, determine whether the color
scheme is light or dark by comparing the luminance of the background and
the foreground colors, instead of looking only at the foreground color.
The rationale is that what determines whether a color scheme is light or
dark is its background color, and even a dark color scheme can still use a
somewhat grayish foreground color that still provides good contrast, but
is below the original half-luma threshold.

For instance, the popular Solarized Dark color scheme uses #839496 for
its foreground color, which has a luma of 0.287658, well below the 0.5
threshold. This causes KDevelop to incorrectly detect it as a light
color scheme, resulting in dark-on-dark generated syntax highlighting
colors which is very difficult to read. This is fixed by this change.


Diffs
-----

  language/highlighting/colorcache.cpp 442a9d8 

Diff: http://git.reviewboard.kde.org/r/113358/diff/


Testing
-------

make test -> OK
Verified that it works as intended, and doesn't break existing behavior.


File Attachments (updated)
----------------

visual example of the change
  http://git.reviewboard.kde.org/media/uploaded/files/2013/10/20/7cf00e06-b62b-46da-be52-44823d9016fc__kdevelop-color-patch.png


Thanks,

Juliano Ravasi

-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://mail.kde.org/pipermail/kdevelop-devel/attachments/20131020/b9ebac8b/attachment.html>


More information about the KDevelop-devel mailing list