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

New achromatic logic in LCH is not sufficient for all achromatic colors #526

Closed
facelessuser opened this issue May 25, 2024 · 1 comment
Closed
Labels
bug Something isn't working
Milestone

Comments

@facelessuser
Copy link
Collaborator

This is due to recent changes on main.

> new Color("white").to('lch').coords
[ 100, 0, null ]
> new Color("gray").to('lch').coords
[ 53.58501345216902, 2.220446049250313e-14, 270 ]
> new Color("darkgray").to('lch').coords
[ 69.23779560557699, 5.978733960281817e-14, 338.1985905136482 ]

I would argue we don't need a super tight check for achromatic chroma. If the expectation is exact zero for null hue or nearly approaching such, that will not be sufficient. As a matter of fact, I would suggest being a bit loose to account for errors introduced by converting to other spaces and round tripping. Some conversion algorithms may be less accurate than others in some cases.

@LeaVerou
Copy link
Member

LeaVerou commented May 25, 2024

The only actual change in logic was that the epsilon is now smaller.
What is the minimum epsilon that would not have these issues?

@LeaVerou LeaVerou added this to the v0.6.0 milestone May 25, 2024
@LeaVerou LeaVerou added the bug Something isn't working label May 25, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working
Projects
None yet
Development

No branches or pull requests

2 participants