You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
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.
The text was updated successfully, but these errors were encountered:
dragonee
changed the title
.lighten() with negative values darkens the color
.lighten() with negative values darkens the color
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 todarken(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.
The text was updated successfully, but these errors were encountered: