Bug 445040 - Accent colors don't apply different hover and focus colours
Summary: Accent colors don't apply different hover and focus colours
Status: ASSIGNED
Alias: None
Product: systemsettings
Classification: Applications
Component: kcm_colors (show other bugs)
Version: 5.23.2
Platform: Other Linux
: NOR normal
Target Milestone: ---
Assignee: Paul McAuley
URL:
Keywords:
Depends on:
Blocks:
 
Reported: 2021-11-05 20:06 UTC by Paul McAuley
Modified: 2021-11-24 19:23 UTC (History)
4 users (show)

See Also:
Latest Commit:
Version Fixed In:
Sentry Crash Report:


Attachments

Note You need to log in before you can comment on or make changes to this bug.
Description Paul McAuley 2021-11-05 20:06:28 UTC
Currently the new accent colour feature sets the hover and focus colours to be the same. It would be better if the hover colour was set to a modification of the focus colour with reduced saturation. This is how it is done in the Breeze colour scheme.

This current implementation is simply enforcing what I see as a design/usability regression from Breeze Light and Breeze Dark on all colour schemes, making the accent colour feature quite unappealing.
Comment 1 Paul McAuley 2021-11-07 22:27:44 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.
Comment 2 Nate Graham 2021-11-08 23:39:26 UTC
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.
Comment 3 Paul McAuley 2021-11-24 19:22:53 UTC
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.