Re: [csswg-drafts] [css-color-4] Disagreements over gamut mapping (#7610)

> Since canvas is driven from script, it is easy for script authors to use their own gamut mapping stage if they wish (like my demo does). Canvas clip can then be seen as a failsafe (if they get this wrong, or don't do it).

My understanding is that the [color-gamut media query](https://www.w3.org/TR/mediaqueries-4/%23color-gamut#color-gamut) exist to allow content authors to do exactly this (with or without script) for CSS Colors.

For instance, one can do custom gamut mapping with the following CSS:
```
<style>
div { background-color: color(srgb 1 0.24 0.08); }
@media (color-gamut: p3) { div { background-color: color(display-p3 1 0.157 0.117); } }
@media (color-gamut: rec2020) { div { background-color: color(rec2020 1 0 0); } }
</style>
```

This solves the problem of rendering out-of-gamut CSS Colors, without introducing any regressions in color matching behavior or performance. It also gives the content author full control over how their page is to do gamut mapping (the author can even implement a perceptual-like mapping if they want).

-- 
GitHub Notification of comment by ccameron-chromium
Please view or discuss this issue at https://github.com/w3c/csswg-drafts/issues/7610#issuecomment-1221310318 using your GitHub account


-- 
Sent via github-notify-ml as configured in https://github.com/w3c/github-notify-ml-config

Received on Saturday, 20 August 2022 12:57:23 UTC