- From: Natalie Weizenbaum via GitHub <sysbot+gh@w3.org>
- Date: Wed, 17 Apr 2024 23:21:45 +0000
- To: public-css-archive@w3.org
nex3 has just created a new issue for https://github.com/w3c/csswg-drafts: == [css-color-4] Gamut mapping pseudocode is confusing == The [sample pseudocode for gamut mapping](https://www.w3.org/TR/css-color-4/#binsearch) is confusing, particularly in step 18 (the "while" loop). There are cases where the pseudocode doesn't say whether the loop should continue looping, but it's not clear whether that means it should terminate or implicitly continue (since 18 says "repeat the following steps"). This is made more confusing by the fact that _sometimes_ the pseudocode does explicitly say to continue, and by the fact that the existence of step 19 implies that there's some way for the loop to terminate without returning a value. For example, if at step 18.3 `min_inGamut` is false and `inGamut(current)` is true, neither condition in 18.3 nor 18.4 will match, and there's no explicit indication what should happen. I tried checking [the Color.js implementation](https://github.com/oddbird/color.js/blob/e48d47280fe4ede809aadbcba3fb94029ace4694/src/toGamut.js#L286-L308) as a reference, but it seems that it runs step 4 incorrectly in this case. What is the correct behavior here? Please view or discuss this issue at https://github.com/w3c/csswg-drafts/issues/10226 using your GitHub account -- Sent via github-notify-ml as configured in https://github.com/w3c/github-notify-ml-config
Received on Wednesday, 17 April 2024 23:21:46 UTC