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

How do gamut ranges interact with ColorSpace#inGamut()? #29

Open
LeaVerou opened this issue Feb 13, 2023 · 0 comments
Open

How do gamut ranges interact with ColorSpace#inGamut()? #29

LeaVerou opened this issue Feb 13, 2023 · 0 comments
Labels
api-design Issues related to API shape

Comments

@LeaVerou
Copy link
Collaborator

LeaVerou commented Feb 13, 2023

In #4, we changed the color space coords to specify metadata instead of just a list of names.
One piece of this metadata is a gamut range, through min and max properties.

However, color spaces also have an inGamut() method.
How do these interact?

  • Option 1: We remove min and max from the coord spec. colorSpace.inGamut() is now the only way to check if a color is in gamut.
  • Option 2: If colorSpace.inGamut() is not specified, it is generated based on these ranges. Otherwise, these ranges are ignored.
  • Option 3: For a color to be in gamut, it needs to pass both of these tests, if both are specified.
  • Option 4: We drop colorSpace.inGamut(). None of the color spaces we support rn needs it (they can be served just fine with range checking), I think it was primarily added to cater to ICC profile use cases.
@LeaVerou LeaVerou added the api-design Issues related to API shape label Feb 13, 2023
@LeaVerou LeaVerou added this to the Level 2+ milestone Mar 20, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
api-design Issues related to API shape
Projects
None yet
Development

No branches or pull requests

1 participant