Re: [csswg-drafts] [css-color-5] `color-mix()` serialization is outdated (#13320)

The CSS Working Group just discussed ``[css-color-5] `color-mix()` serialization is outdated``, and agreed to the following:

* `RESOLVED: Require serializing without color space if it matches the default (oklab)`
* `RESOLVED: Multiple identical entries do not collapse.`
* `RESOLVED: Colors are not collapsed`
* `RESOLVED: If percentages for N arguments are 1/N (and are therefore all omittable), omit them.`
* `RESOLVED: If percentages for N arguments are 1/N (and are therefore all omittable), omit them. Otherwise serialize the percentages (even if originally omitted).`
* `ACTION: update spec to handle hue-interpolation method`

<details><summary>The full IRC log of that discussion</summary>
&lt;emilio> ChrisL: it is<br>
&lt;emilio> ... I had some problems with how to update it<br>
&lt;emilio> ... it used to be the case that you had two colors and if you don't specify them it's 50% and 50%<br>
&lt;emilio> ... so with more colors I'd expect 100% / N<br>
&lt;fantasai> emilio: Some implementation updates already, so can check what happens<br>
&lt;emilio> Rossen: is there any other sensible alternative?<br>
&lt;Rossen> ack fantasai<br>
&lt;emilio> fantasai: some questions about color-interpolation-method being optional<br>
&lt;emilio> ... we are probably happy to make that change?<br>
&lt;emilio> ChrisL: we already resolved on it, but yeah it should serialize to the shortest value (omit oklab if needed)<br>
&lt;emilio> PROPOSED: Allow to serialize without color space if it matches the default (oklab)<br>
&lt;emilio> s/Allow to serialize/Require serializing<br>
&lt;emilio> emilio: potential compat is `color-mix(in oklab,` now serializes without<br>
&lt;emilio> ... but probably fine<br>
&lt;emilio> fantasai: another one would be do we ever plan to change the default<br>
&lt;emilio> emilio: Even if we changed it we would potentially be breaking stuff so I'd rather do the simple thing and omit oklab<br>
&lt;emilio> PROPOSED: Require serializing without color space if it matches the default (oklab)<br>
&lt;emilio> RESOLVED: Require serializing without color space if it matches the default (oklab)<br>
&lt;emilio> ChrisL: other question is serializing with identical colors, like `color-mix(green, green, green, red)`, so you need to preserve them<br>
&lt;emilio> TabAtkins: you could do `green 75%, red 25%)`<br>
&lt;fantasai> PROPOSED: Multiple identical entries do not collapse.<br>
&lt;fantasai> RESOLVED: Multiple identical entries do not collapse.<br>
&lt;kbabbitt> +1<br>
&lt;emilio> RESOLVED: Colors are not collapsed<br>
&lt;emilio> fantasai: if you have both percentages 50% do you serialize them?<br>
&lt;emilio> ChrisL: the current algorithm omits the percentages<br>
&lt;fantasai> PROPOSED: If percentages for N arguments are 1/N (and are therefore all omittable), omit them.<br>
&lt;emilio> fantasai: if I write `red 50%, green 25%, blue 25%`, how do we serialize that out?<br>
&lt;fantasai> color-mix(red 50%, green 25%, blue 25%)<br>
&lt;fantasai> color-mix(red 50%, green, blue)<br>
&lt;fantasai> color-mix(red, green 25%, blue 25%)<br>
&lt;lea> q?<br>
&lt;lea> q+<br>
&lt;emilio> fantasai: we don't know what you meant, I suggest we drop the percents if all drop<br>
&lt;emilio> ChrisL: the current text says "if both are 50% you drop them, otherwise you don't"<br>
&lt;emilio> ... I'd like to preserve that, only drop if all are omittable<br>
&lt;Rossen> ack lea<br>
&lt;emilio> lea: we do have this rule<br>
&lt;emilio> ... about shortest serialization<br>
&lt;emilio> ... could be useful?<br>
&lt;emilio> emilio: within reason :)<br>
&lt;emilio> fantasai: if you have four colors there's no single answer<br>
&lt;ChrisL> as simple as possible. but no simpler<br>
&lt;lea> `red 30%, green 30%, yellow 20%, purple 20%`<br>
&lt;fantasai> PROPOSED: If percentages for N arguments are 1/N (and are therefore all omittable), omit them. Otherwise serialize the percentages (even if originally omitted).<br>
&lt;lea> +1<br>
&lt;emilio> RESOLVED: If percentages for N arguments are 1/N (and are therefore all omittable), omit them.<br>
&lt;fantasai> RESOLVED: If percentages for N arguments are 1/N (and are therefore all omittable), omit them. Otherwise serialize the percentages (even if originally omitted).<br>
&lt;fantasai> ACTION: update spec to handle hue-interpolation method<br>
</details>


-- 
GitHub Notification of comment by css-meeting-bot
Please view or discuss this issue at https://github.com/w3c/csswg-drafts/issues/13320#issuecomment-4166024211 using your GitHub account


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

Received on Tuesday, 31 March 2026 22:31:55 UTC