Does anyone know how Plasma determines what is a light or dark color scheme?

So I’ve got bunch of color themes in /usr/share/color-schemes. With Plasma 6, I’ve noticed it now interacts with the browsers, so if plasma determines the color scheme you select is a “dark” scheme, then Chromium/Edge will set themselves to use dark themes. But one of my themes that Plasma says is a “dark” theme has basically all light colors. I can’t seem to figure out how it determines what to classify as light and what to classify as dark. Anyone know?

Good question. I know there were some talks in the past about this, but I think it was never standardized.

Thankfully, Plasma is open source, so I’ve found this in the code (click on the link it will take you to the exact line)

TLDR, it is calculating the “qGray” value of the window color, and it’s a dark scheme if that is lower than 192.

Ridiculous if you ask me, but I guess it’s good enough in the absence of any standard.

2 Likes

Wow, thanks a ton. That’s super helpful!! So I just need to lower a few colors value enough to get it above 192…that works. Agreed that it’s a rather ridiculous way to calculate it, but…at least now I have something to go after!

Edit: It does indeed work. Changed a couple values of window normal background to lighten that just a LITTLE bit (it was around 180 already), and now it shows up as a light theme!!!

Thanks again!!!

1 Like

This topic was automatically closed 2 days after the last reply. New replies are no longer allowed.