facelessuser / coloraide

A library to aid in using colors
https://facelessuser.github.io/coloraide
MIT License
194 stars 12 forks source link

Gamut mapping fixes and adjustments #382

Closed facelessuser closed 10 months ago

facelessuser commented 10 months ago
  1. When gamut mapping, the color space attribute GAMUT_CHECK should be used not only to check whether a color is in gamut, but it should be used as the color reference color space when gamut mapping.
  2. When clipping, there are some cases where we can get away with clipping a color in the origin color space even when GAMUT_CHECK specifies a different color space. This saves us time and improves performance. It also allows us to keep compatibility with CSS. To enforce a clipping color space, a space can now set the color space attribute CLIP_SPACE to a specific space.
facelessuser commented 10 months ago

@gir-bot lgtm