[csswg-drafts] [css-color-4] Conversion examples give unexpected results (lab -> sRGB, lab -> P3, ...) (#6816)

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

== [css-color-4] Conversion examples give unexpected results (lab -> sRGB, lab -> P3, ...) ==
Have been working on a [postcss-lab-function](https://github.com/csstools/postcss-lab-function) and found some discrepancies in colors converted with the code found here : https://github.com/w3c/csswg-drafts/blob/main/css-color-4/conversions.js

I am unsure if I am doing this wrong, or if there is a real issue.
It might also be a bug in Safari as there is no other browser I can compare it with.

Results :

- lab : https://romainmenke.github.io/lab-lch-display-p3/lab.html
- lch : https://romainmenke.github.io/lab-lch-display-p3/lch.html

(Safari 15 supports all features, so can be used to compare)

Code used in the conversion :

https://github.com/romainmenke/lab-lch-display-p3/blob/main/conversion.js#L1-L60


- P3 values are used as is
- sRGB values are multiplied by 255

Would be great to pinpoint were this goes wrong so that I am sure the plugin uses correct conversions.

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


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

Received on Monday, 15 November 2021 17:21:09 UTC