paulmcauley / klassy

Klassy is a highly customizable binary Window Decoration, Application Style and Global Theme plugin for recent versions of the KDE Plasma desktop.
843 stars 24 forks source link

Close button has a white border when highlighted on an inactive window #74

Closed slightlyfaulty closed 10 months ago

slightlyfaulty commented 1 year ago

It seems no matter which settings I use, the close button always highlights with a white/light border when hovered over on an inactive window.

The only thing that seems to stop this from happening is if Translucent backgrounds is disabled.

Klassy Close Border

paulmcauley commented 1 year ago

There is an auto-contrast detection algorithm. If it detects that there is not enough contrast between the button background and the titlebar/header colour then it will draw an outline around the button.

This works well most of the time but in some cases it doesn't. That's because it is a luma(greyscale)-based contrast detection algorithm from https://api.kde.org/frameworks/kguiaddons/html/namespaceKColorUtils.html#a9387fe7f2518a87367d9cbc82007994f and probably sees the greyscale values as similar. If you know of a better algorithm that can work in more cases then let me know.

slightlyfaulty commented 1 year ago

Thanks for the explanation. I've played around with it a bit now and the grayscale contrast detection definitely doesn't work well in many cases. But that said, I understand why some form of contrast detection is necessary, and personally I can work around how it functions now, so it's not a big deal for me now that I know why it's happening.

Thanks again and keep up the great work. Klassy is awesome!

paulmcauley commented 1 year ago

duplicate of #46

paulmcauley commented 11 months ago

I may add a setting for the poor-contrast mitigation to be disabled

paulmcauley commented 10 months ago

This now will no longer happen on master. The background colour is now adjusted in poor contrast situations instead of drawing an outline. It is now also configurable.