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

scale-lightness behavior changed from 1.3.3 to 1.3.4 #160

Open
paroda opened this issue Mar 1, 2018 · 2 comments
Open

scale-lightness behavior changed from 1.3.3 to 1.3.4 #160

paroda opened this issue Mar 1, 2018 · 2 comments

Comments

@paroda
Copy link

paroda commented Mar 1, 2018

Hi,

This is a really great library, which helped me stick to clojure all the way, even with CSS styling. I even find the color utility functions very neat and useful. They helped me a lot in my recent work. But then, I got surprised suddenly when I switched from version 1.3.3 to 1.3.4 when the colors suddenly were different from what I had planned earlier. Not sure what is the general understanding of scaling. However, the behavior of garden.color/scale-lightness was more appropriate in version 1.3.3, rather than in 1.3.4. Or may be it is me only. My understanding is like if you lighten any color with 100%, it goes to 100% lightness, that is white. And if you lighten -100% it would become black. Then any other number between -100 to 100 would be a color in between. And this was the behavior in 1.3.3.

(scale-lightness (hsl 50 50 80) 50) => (hsl 50 50 90) ;; NOT (hsl 50 50 100) !
(scale-lightness (hsl 50 50 80) 75) => (hsl 50 50 95)
(scale-lightness (hsl 50 50 80) 100) => (hsl 50 50 100)

This actually helps in easily creating lighter shades from a base color. Just take 10, 20, 30, 40 .. 90 percent lighter. And it perfectly matches the use case.

I would like if the old behavior can be restored or retained as another function with a different name. For now I have written my own lighten function by copying the older code to my project, but I believe it's right place is in garden.color

Thank you again for this wonderful library.

@noprompt
Copy link
Owner

@paroda Thank you for the kind words. The scaling functions were changed in the patch accompanying this pull request. It seems like folks (including myself) found that to be the correct behavior, however, I can understand a different point of view. After all, I wrote the original behavior! Perhaps there's a concept here and we're just not naming it appropriately?

@noprompt
Copy link
Owner

This also should have been explained in our ChangeLog. Apologies for leaving that out!

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