Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Automatically determine dark/light theme from theme colors #77

Open
tbethe opened this issue Apr 25, 2023 · 1 comment
Open

Automatically determine dark/light theme from theme colors #77

tbethe opened this issue Apr 25, 2023 · 1 comment

Comments

@tbethe
Copy link

tbethe commented Apr 25, 2023

So, I have this weird idea. There are some programs that I do not want to theme, but I just want them to use their own dark or light theme. Which one, I would like to depend on the currently selected theme.

For this, I have the following idea: Take the background colors and take their average darkness (for example, by splitting up RGB, and seeing how dark they are) and using this to determine if the theme is more a light or dark theme.

Perhaps there could be a command line option to get the dark/lightness of the current theme.

Example of how to calculate this: https://stackoverflow.com/questions/596216/formula-to-determine-perceived-brightness-of-rgb-color

I'm planning to work on this and submit a pull request, at some point.

@Misterio77
Copy link
Owner

This sounds good! Feel free to open up a PR.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants