| Summary: | Accent colors don't apply different hover and focus colours | ||
|---|---|---|---|
| Product: | [Applications] systemsettings | Reporter: | Paul McAuley <kde> |
| Component: | kcm_colors | Assignee: | Paul McAuley <kde> |
| Status: | ASSIGNED --- | ||
| Severity: | normal | CC: | agurenko, jpwhiting, mwoehlke.floss, nate |
| Priority: | NOR | ||
| Version First Reported In: | 5.23.2 | ||
| Target Milestone: | --- | ||
| Platform: | Other | ||
| OS: | Linux | ||
| Latest Commit: | Version Fixed/Implemented In: | ||
| Sentry Crash Report: | |||
|
Description
Paul McAuley
2021-11-05 20:06:28 UTC
I worked around this in my own C++ window decoration by doing the following:
if(buttonFocusColor == buttonHoverColor) buttonHoverColor = ColorTools::getDifferentiatedLessSaturatedColor(buttonHoverColor);
QColor ColorTools::getDifferentiatedLessSaturatedColor( const QColor& inputColor )
{
int colorHsv[3];
inputColor.getHsv(&colorHsv[0], &colorHsv[1], &colorHsv[2]);
if( colorHsv[1] > 125 ) colorHsv[1] -= 80; //decrease saturation if not already low
else colorHsv[1] += 80; // else increase saturation if very low to provide differentiation/contrast
QColor outputColor;
outputColor.setHsv(colorHsv[0], colorHsv[1], colorHsv[2]);
return outputColor;
}
I have to still apply this in several other places in the application style where hover and focus colours are the same, and it would be better if I didn't have to do this at all.
Seems reasonable to me. Feel free to submit a MR that fixes it, as well as a separate one to fix the color issues in Breeze Light and Breeze Dark. OK, I will take a look at this soon. I have came up with some different saturation thresholds than I posted in the code above, which work better with all the standard system accent colours, so will try to port them to Plasma. |