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

toHex sometimes returns the wrong color #235

Closed
jafaircl opened this issue Oct 30, 2020 · 3 comments · Fixed by #236
Closed

toHex sometimes returns the wrong color #235

jafaircl opened this issue Oct 30, 2020 · 3 comments · Fixed by #236

Comments

@jafaircl
Copy link

jafaircl commented Oct 30, 2020

The 2 specific examples I've seen are:

// #b00020 is a red
toHex(darken('#b00020', 0.2)) // returns #4d00e0 (a purple) instead of #7D0000
// this one seems to just switch the first 2 numbers
toHex('#03dac5') // returns #30dac5

I got the correct values from this tool. Here is a stackblitz where you can see the issue.

For the first one, if you drop the darkening factor to 0.18, it returns a red.

This may be related somehow to #211

@ricokahler
Copy link
Owner

Thanks for this report and the reproduction!

For now I've opened up a PR with a failing test of your reproduction. I should have a fix out within 24 hours.

@ricokahler
Copy link
Owner

ricokahler commented Oct 31, 2020

sigh lol 51bca74

thanks for the report! this is release in 1.1.1

@jafaircl
Copy link
Author

Well at least it was an easy fix. Thanks!

@renovate renovate bot mentioned this issue May 31, 2021
1 task
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

Successfully merging a pull request may close this issue.

2 participants