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

Should color equality consider missing channels to be unequal to 0? #3645

Open
nex3 opened this issue Aug 1, 2023 · 2 comments
Open

Should color equality consider missing channels to be unequal to 0? #3645

nex3 opened this issue Aug 1, 2023 · 2 comments

Comments

@nex3
Copy link
Contributor

nex3 commented Aug 1, 2023

Currently, the color spec defines equality as just each component being fuzzy-equal to one another. This implies that lch(50% 50% none) == lch(50% 50% 0deg), since we say missing channels are treated as 0 anywhere they aren't mentioned explicitly. Is that desirable behavior? Or should we have a special carve-out for missing channels that makes them only equal to other missing channels?

@mirisuzanne
Copy link
Contributor

I think we likely want a carve-out for that, since we've gone with a more strict definition of equality.

@nex3
Copy link
Contributor Author

nex3 commented Aug 21, 2023

We could potentially add (in a future change) a color.visual-equals() function which returns true if two colors will look the same on all displays (essentially, if they're equal in XYZ space).

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

2 participants