Auto-adapt hardcoded colors to current color scheme
Review Request #115928 - Created Feb. 20, 2014 and submitted
This code is used like that for years in KDevelop and works quite nicely for most cases. Note that for darker color schemes, this most often results in a bit less-intense colors which is not a big problem as colors stand out much more against a dark background. And its better than before, where you'd end up with hard-coded colors for a bright background scheme... Bright color schemes are not affected, as long as they fulfill the conditition of having a lower luma for the background color compared to the foreground color.
Created a new kate scheme with a dark and with a bright system color scheme. The bright one stayed as-is. The dark one auto-adapted all colors - even those hardcoded in highlighting .xml files! The result is an always-readable text on dark schemes, where previously hard coded colors lead to unreadable mess which one had to fix manually...
Hmm, as I use no dark scheme, I have no real opinion here. For KDE 4.x it seems like a reasonable workaround for hard-coded colors, for KF5, if we remove the hard-coded colors in the xmls in favor of more default roles, it might not be that relevant anymore, or? Still guess can't hurt, but others shall decide here, that perhaps use dark schemes ;)
Review request changed
don't re-adapt colors when they are loaded from a config file
Revision 2 (+36 -18)