Re: [csswg-drafts] [css-color-hdr] How should checking for percentages summing to 0 work in dynamic-range-limit-mix() when calc() is used? (#11678)

> Yeah, I think the right answer is to just make the output transparent black when the sum is zero.

Currently, for `color-mix()`,  browsers mark the property value as invalid (which was correct until 2 weeks ago). However we can see what they would do otherwise by making the percentages very close to zero (like 0.01%) and then using RCS to make the alpha 1 again.

```css
background-color: oklab(from color-mix(in oklab, red 0.01%, green 0.01%) l a b / 1);
```

[Live test](https://codepen.io/svgeesus/pen/xbxPjvV) shows that they do not produce transparent black; they produce the actual mixed color. So we would have a discontinuity at 0%. Which may be the best we can do.

The current spec text needs to be updated, because with percentages summing to zero there is no defined color produced.

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


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

Received on Thursday, 13 March 2025 18:02:47 UTC