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

hsla parsing incorrectly #118

Closed
tarngerine opened this issue Apr 28, 2021 · 3 comments
Closed

hsla parsing incorrectly #118

tarngerine opened this issue Apr 28, 2021 · 3 comments

Comments

@tarngerine
Copy link

hi! love this library! thanks for all your hard work :)

ran into a bug — culori parses hsla (per https://www.w3.org/wiki/CSS3/Color/HSLA) expecting alpha to be 0-255, when the spec specifies 0-1, so other things like react-colorful provide an alpha value that culori incorrectly processes

https://codesandbox.io/s/fervent-http-21ywl?file=/src/App.js

hsla(219, 34%, 46%, 1)
becomes
{"mode":"hsl","h":219,"s":0.34,"l":0.46,"alpha":0.00392156862745098}
instead of
{"mode":"hsl","h":219,"s":0.34,"l":0.46,"alpha":1}

@danburzo
Copy link
Collaborator

Thanks for the report, @tarngerine! Good catch, will fix in a sec.

@danburzo
Copy link
Collaborator

Fixed in culori@0.18.2.

@tarngerine
Copy link
Author

wow! so fast. thank you!

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