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 and darken with amount 0 are not returning the original color #211

Open
marsonmao opened this issue Oct 19, 2020 · 2 comments
Open
Labels
help wanted Extra attention is needed

Comments

@marsonmao
Copy link

For example:

      const color = lighten('#ffb537', 0);

and

      const color = darken('#ffb537', 0);

both return #ffb638.

I think it should return the original color?

@ricokahler
Copy link
Owner

ricokahler commented Oct 19, 2020

Yeah that's definitely a weird result. I'll take a look later today this week.

My gut says that it's an artifact of parsing to HSL and then back to hex (rounding error?). Maybe there's a way to round there that doesn't cause this.

@ricokahler
Copy link
Owner

My schedule has been pretty hectic and I haven't really investigated too deeply into this.

Quick pulse check: how important is this issue to you? Do you have a specific use case where this result is undesirable?

Thanks!

@ricokahler ricokahler added the help wanted Extra attention is needed label Nov 12, 2020
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
help wanted Extra attention is needed
Projects
None yet
Development

No branches or pull requests

2 participants