culori
culori copied to clipboard
Add to `clampChroma` option to clamp to P3 space
P3 space is widely used (any modern Apple tech) and give a lot of new color.
We are using clampChroma to generate dynamic accent color. It would be nice to be able to clamp chroma not just to fit sRGB, but also to fit P3.
Hi @ai, thanks for the suggestion and sorry for the late response. This feature is captured in the PR:
- https://github.com/Evercoder/culori/pull/165
It introduces more generic functions for clampChroma, clampRGB, and displayable.
Cool! But this PR will break TypeScript PR.
Can we merge TS first? TS is very important for modern days DX.
Although initially planned for https://github.com/Evercoder/culori/pull/165, the PR does not include an implementation of toGamut(), which this feature request is concerned with.
Some references on the topic:
- https://github.com/w3c/csswg-drafts/issues/7653
- https://github.com/w3c/csswg-drafts/issues/7610
- https://github.com/w3c/csswg-drafts/issues/7071
- https://github.com/LeaVerou/color.js/issues/154
- https://github.com/LeaVerou/color.js/issues/63
- https://github.com/w3c/csswg-drafts/issues/7135