* 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
| 111 | * The 0.08 saturation covered all the white tones found in the color schemes tested. |
| 112 | */ |
| 113 | bool 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). |