-
Notifications
You must be signed in to change notification settings - Fork 746
Closed
Labels
Description
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:
color-mix(in srgb, blue, red 50%) -> rgb(128, 0, 128)
whereas WebKit is serializing it as:
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.
- The use of
srgb
as the color space in thecolor-mix()
gave it symmetry. - 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(), color-contrast(), and relative color syntax, 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.)
svgeesus and argyleink