[csswg-drafts] [css-color-5] More clarity around the percentage in color-mix() (#6064)

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

== [css-color-5] More clarity around the percentage in color-mix() ==
[The defintition of `color-mix()` in CSS Colors level 5](https://drafts.csswg.org/css-color-5/#color-mix) includes a `<percentage>` value for defining the relative weight of the colors being mixed. That weight is given to one of the two colors, with the remaining percentage given to the other color.

From the examples, I can infer that the given weight is used for the _first_ color, and the remaining percentage is applied to the _second_ color – `color-mix(red 80% blue in lch)` will be 80% red and 20% blue – but I don't think that's clearly stated anywhere. It also seems to contradict this note:

> Note: As a corrollary, 0% just returns the first color converted to the specified colorspace, 100% returns the second color converted to the specified colorspace, and 50% produces an equal mix of both.

I would expect that to be the opposite. 

- If we apply `0%` of the first color, we should get the second one converted to a given colorspace.
- If we apply `100%` of the first color, we should get that same color, but converted.

(I'm not sure if there's also a way to make this more clear in the syntax, but that's a separate issue. I have to look this up every time I use the Sass function as well. My mind refuses to retain this information…)

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


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

Received on Tuesday, 2 March 2021 19:12:09 UTC