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

Add P3 support to displayable #161

Closed
ai opened this issue Feb 22, 2022 · 2 comments · Fixed by #165
Closed

Add P3 support to displayable #161

ai opened this issue Feb 22, 2022 · 2 comments · Fixed by #165

Comments

@ai
Copy link

ai commented Feb 22, 2022

displayable now supports only sRGB, but we have many P3 screens in Apple ecosystem (and Safari support for P3 colors in CSS).

Can we add displayableP3?

@danburzo
Copy link
Collaborator

Hi @ai, thanks for the report.

I think it would be a good idea to have a more general inGamut(mode) -> function(color) method that covers all bounded color spaces. This depends on adding the reference ranges for all color spaces:

You could then write:

const displayableP3 = inGamut('p3');
displayableP3('color(rec2020 1 0.5 0)');

The term displayable has become somewhat of a misnomer now that the gamut has been extended beyond sRGB. When expressed as color(srgb ...), a color can be displayed even if it has components outside the [0, 1] range.

@ai
Copy link
Author

ai commented Feb 22, 2022

I like this API 👍

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

Successfully merging a pull request may close this issue.

2 participants