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

.lighten() with negative values darkens the color #204

Open
dragonee opened this issue Dec 10, 2018 · 0 comments
Open

.lighten() with negative values darkens the color #204

dragonee opened this issue Dec 10, 2018 · 0 comments

Comments

@dragonee
Copy link

dragonee commented Dec 10, 2018

It appears that values lower than 0 are accepted, which contradicts the documentations (which says that values are in 0-100 range). This results in somewhat unexpected behaviour, where lighten(-15) does somewhat similar thing to darken(15).

There are a few possible solutions I can come up with. The best one would be to clamp input values to 0-100. The rationale is that the scale for lighten and darken is different and depends on the luminosity of the original color.

Example - I have a color that has 70% luminosity. lighten(100) does 70+30 = 100 luminosity. lighten(-100) does 70-30 = 40% which is strange or the stepping value is different, which would also be strange.

So I would vote for removal of this unexpected behaviour.

@dragonee dragonee changed the title .lighten() with negative values darkens the color .lighten() with negative values darkens the color Dec 10, 2018
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

1 participant