[csswg-drafts] [css-color-4] Gamut mapping pseudocode was changed incorrectly (#9715)

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

== [css-color-4] Gamut mapping pseudocode was changed incorrectly ==
              @svgeesus I'm a bit confused by the change in https://github.com/w3c/csswg-drafts/commit/06748226bb73a7fee401ba0d00c4e4655ec17555 - I think you may have added the early return in the wrong place, and then removed some needed steps that had become unreachable.

The change we were looking to make in # 2 above was to insert after line 10:

- set |current| to |origin_Oklch|
- set |clipped| to clip(|current|)
- set |E| to delta(|clipped|, |current|)
- if |E| < |JND| return |clipped| as the gamut mapped color

This is identical to the logic within the `while`, but crucially is checked _before_ the chroma is adjusted.

_Originally posted by @jamesnw in https://github.com/color-js/color.js/issues/352#issuecomment-1823219851_
            


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


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

Received on Saturday, 16 December 2023 23:46:57 UTC