Repository navigation
[css-color-4] adjust raytracing algorithm to account for some edge cases - #14698
Conversation
|
@romainmenke I had a potential fix for this same issue, but I think your solution is more robust, so I'm going to say yours looks better for the spec. On a side note, we need to add that the initial anchor should be clamped to [0, 1]. Conversion floating-point noise can leave an anchor slightly outside the cube and can cause a similar issue where the color is not found on the gamut surface and gets clipped, giving an incorrect, saturated color, even if you've done the lightness check earlier. This mainly can occur near black and white. This is a real issue that can occur, and the spec does not have this protection. If this case is handled separately, that is fine, but it really should be included in the spec as well. |
|
I've added the anchor clamp to the spec |
|
@romainmenke Two other small recommendations:
That would address any current known issues. |
|
Also applied those, thanks! |
|
LGTM |
Without this adjustment:
A matrix of colors in
oklchwithc = 0.2,l = 100%at the topl = 0%at the bottom and starting from the left ath = 0deg. It shows a pure red cell in a region that should be near blackAfter:
The same matrix, but this time there is no cell with an unexpected value
@facelessuser would be great if you could check this, thanks 🙇