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

HSL color incorrectly translates to RGB color #786

Open
woodroof opened this issue Jul 3, 2024 · 4 comments
Open

HSL color incorrectly translates to RGB color #786

woodroof opened this issue Jul 3, 2024 · 4 comments

Comments

@woodroof
Copy link

woodroof commented Jul 3, 2024

For example, hsl(230, 57%, 54%) should be translated to #475dcd, but usvg returns #465dcc.
r component value is 70.839, so it should be rounded to 71 (0x47).

@RazrFalcon
Copy link
Collaborator

I'm not sure I would call it "incorrectly". Just a different rounding to what you're expecting.
It's not a lossless operation to begin with.

@woodroof
Copy link
Author

woodroof commented Jul 3, 2024

Maybe "incorrectly" is not a right word, but still usvg selects not a closest rgb color, and that can be improved.

@woodroof
Copy link
Author

woodroof commented Jul 3, 2024

I can make a PR if you show me a place where this transformation is happening.

@RazrFalcon
Copy link
Collaborator

+/-1 difference is perfectly normal. But Chrome seems to be rounding up, so should we.
Will fix in the next update.

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