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

Feature request: ability to control the brightness value at which a color is considerd dark or light #231

Open
DanielCashlink opened this issue May 12, 2022 · 1 comment

Comments

@DanielCashlink
Copy link

Currently the isDark and isLight is determined by checking the brightness against a static 128 value, however it would be nice to be able to adjust this value(I've found, for example, that 170 fits my needs better). Potentially add an option in the constructor, maybe as part of TinyColorOptions: {brightnessThreshold: number}.

I'm aware that you can get around it by doing const isDark = tinyColor.getBrightness() < 170;, but this proposal would allow the user to create a wrapper around TinyColor, and have a default brightness threshold across the entire app, and not have to manually specify it every time.

@scttcper
Copy link
Owner

sounds very reasonable

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