[csswg-drafts] [css-color-4] Gamut Mapping Clarifications (#9651)

jamesnw has just created a new issue for https://github.com/w3c/csswg-drafts:

== [css-color-4] Gamut Mapping Clarifications ==
In implementing the [Gamut Mapping Algorithm](https://drafts.csswg.org/css-color/#binsearch) in Color.js, I found a few areas where clarification in the pseudocode could be helpful. If any of these are too pedantic for pseudocode, feel free to ignore.

1. In step 1, replace `return |origin|` with `convert |origin| to |destination| and return it as the gamut mapped color`. The explicit conversion is the important bit, the "as the gamut mapped color" is for parity with the other returns.
2. In step 10, defining `clip`, should we change it to specify it clamps to the range of the color channel, instead of 0-1? This may be a moot point, as it appears that only unbounded spaces which don't go through this portion have channel ranges besides 0-1.
3. In steps 3 and 4, where we return white/black, should we specify white/black instead of 1's and 0's? Like # 3, this may be a moot point, as only unbounded spaces appear to have other channel values for white/black.
4. Nit: In step 10, defining `clip`, there's an extra pipe character at the end of `clip(color)|`

Please view or discuss this issue at https://github.com/w3c/csswg-drafts/issues/9651 using your GitHub account


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

Received on Wednesday, 29 November 2023 16:16:50 UTC