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

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

This is an automatically generated e-mail. To reply, visit:

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

Review request for KDevelop.


Add screenshot showing the before/after the change.

Repository: kdevplatform


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.


  language/highlighting/colorcache.cpp 442a9d8 



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

File Attachments (updated)

visual example of the change


Juliano Ravasi

-------------- next part --------------
An HTML attachment was scrubbed...
URL: <>

More information about the KDevelop-devel mailing list