[csswg-drafts] [css-color-5] Clarify serialization of color-mix() (#6206)

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

== [css-color-5] Clarify serialization of color-mix() ==
In the recently added color-mix() test in WPT, https://github.com/web-platform-tests/wpt/blob/master/css/css-color/color-mix-basic-001.tentative.html, Firefox and WebKit already disagree on the results.

Firefox (and the test, since it was imported from Firefox) is currently serializing the result of a color-mix in srgb as:

```css
color-mix(in srgb, blue, red  50%)  -> rgb(128, 0, 128)
```

whereas WebKit is serializing it as:

```css
color-mix(in srgb, blue, red  50%)  -> color(srgb 0.5 0 0.5)
```

I chose the `color(srgb ...)` syntax serialization for WebKit for two reasons.

1. The use of `srgb` as the color space in the `color-mix()` gave it symmetry.
2. The use of the `color(srgb ...)` syntax gives more precision in WebKit, and therefore a mix could be more precise.

Either way, I think this should be clarified in the spec.


(Side note, I have a bunch of tests for [color-mix()](https://trac.webkit.org/browser/webkit/trunk/LayoutTests/fast/css/parsing-color-mix.html), [color-contrast()](https://trac.webkit.org/browser/webkit/trunk/LayoutTests/fast/css/parsing-color-contrast.html), and [relative color syntax](https://trac.webkit.org/browser/webkit/trunk/LayoutTests/fast/css/parsing-relative-color-syntax.html), but have not proposed them for WPT since the specs were still actively moving targets, but if they would be useful, I would be happy to make a PR for WPT.)

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


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

Received on Sunday, 11 April 2021 17:27:46 UTC