culori
culori copied to clipboard
Add P3 support to `displayable`
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?
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:
- https://github.com/Evercoder/culori/issues/153
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.
I like this API 👍