p-connor / plasma-drawer

A customizable fullscreen launcher widget for KDE Plasma
84 stars 4 forks source link

[Bug] Text don't pick better contrasting colors #52

Closed ryu-ketsueki closed 10 months ago

ryu-ketsueki commented 1 year ago

Describe the bug I occasionally use a light mode color scheme on my desktop, particularly when it's day, and dark mode when it's night. But even on light mode, I prefer to have Plasma Drawer with a dark background, The problem with that is that the text for the icons stay black in light mode, even when the background is set to color black

To Reproduce Steps to reproduce the behavior:

  1. Set a Light Mode Color Scheme on Plasma
  2. Set the background of Plasma Drawer to a dark one, preferably black
  3. Set the opacity to a high number, like 70%
  4. See how the text of the icons remain black in a dark background

Expected behavior The text of the icons and search results stay black

Screenshots Spectacle_20230529_071625

Device (please complete the following information, which can be found in the KInfoCenter): Operating System: openSUSE Tumbleweed 20230527 KDE Plasma Version: 5.27.5 KDE Frameworks Version: 5.106.0 Qt Version: 5.15.9 Kernel Version: 6.3.4-lqx1-1-liquorix (64-bit) Graphics Platform: Wayland Processors: 4 × Intel® Core™ i3-7020U CPU @ 2.30GHz Memory: 11.5 GiB of RAM Graphics Processor: Mesa Intel® HD Graphics 620 Manufacturer: LENOVO Product Name: 81FE System Version: Lenovo ideapad 330-15IKB

p-connor commented 1 year ago

Hmm, this is an interesting problem because it requires the text color to be dynamic. However, it can’t just switch between a predefined black and white as users would probably expect that it matches their theme text color (which sometimes is tinted or a lighter shade etc). I could add another configuration option to manually set the text color, but this feels like it might add unnecessary complexity to the config page. What I think I may do instead is to simply use the theme text color when the background is set to match the theme, and then switch to an adaptive black/white when the background is in custom color mode based on the selected color. Now as for when the background has a custom image, this may be more tricky. I may try to read the average image brightness/color to determine which text color to use but I’m not sure how easy that is. I will have to look into it, thanks for the notice