MCPcopy Create free account
hub / github.com/KDE/kdevelop / canInvertBrightColor

Function canInvertBrightColor

kdevplatform/util/widgetcolorizer.cpp:113–117  ·  view source on GitHub ↗

* Inverting is used for white colors, because it is assumed white in light color scheme * should be black in dark color scheme. White inverted will give you black, but blending * would give you a grey color depending on the ratio. Above 0.5 (middle) will ensure all * whites are inverted in blacks (below 0.5) and exactly 0.5 can stay the same. * The 0.08 saturation covered all the white tones f

Source from the content-addressed store, hash-verified

111 * The 0.08 saturation covered all the white tones found in the color schemes tested.
112 */
113bool canInvertBrightColor(const QColor& color)
114{
115 // this check here determines if the color can be considered close to white
116 return color.valueF() > 0.5 && color.hsvSaturationF() < 0.08;
117}
118
119/**
120 * Blending is used for non white (colorful?) colors to increase contrast (get a brighter color).

Callers 1

collectRangesFunction · 0.85

Calls

no outgoing calls

Tested by

no test coverage detected