Re: [csswg-drafts] [css-color-4] Evaluate static gamut mapping algorithms for oklab/oklch spaces (#10579)

@svgeesus 

## GMA algorithm

2\) seems to have a comment at the end that needs to be removed `!-- constrain to SDR lightness range, which gamut maps to black or white -->`

5\) has `and h_origin.` at the end which should be removed

## Ray trace algorithm

6\) `if (tnear > tfar or tfar < 0` Seems it is missing a `)`

9\) `for (i =0; i lt; 3; i++):` I think you mean t `i < 3`, maybe an HTML enitity typo?

9\) and 10\) seem to reuse `end` to store the intersection. This should probably not be done, assuming `end` is the current RGB point and not a copy. Once we've got the intersection, we want to use that RGB point (not the intersection) to update the anchor, but only after we've used the old anchor. If we overwrite the RGB point with the intersection, we'll end up not having the anchor update properly. Depending on the language, this could be handled a number of ways, `end` is a copy of the data, you could pass in a reference to an array that will be filled with the intersection, you could allocate and return a new array as well, etc. I think this should be written in a way that does not lead people to believe they could overwrite the original data.

Outside of that, I think everything seems correct. We'll see if/when people start to try and implement.



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


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

Received on Sunday, 25 January 2026 00:36:51 UTC