Re: [csswg-drafts] [css-color-4] Linear transformation matrices are very slightly inaccurate (#7675)

> For example, the [xyz-d50-001 test case](https://github.com/web-platform-tests/wpt/blob/master/css/css-color/xyz-d50-001.html)

[Converting `color(xyz-d50 0.08312 0.154746 0.020961)`](https://colorjs.io/apps/convert/?color=color(xyz-d50%200.08312%200.154746%200.020961)&precision=6) I get an OOG for sRGB: `rgb(-0.0768% 50.1978% 0.00773%)`

[Converting `#008000`](https://colorjs.io/apps/convert/?color=%23008000&precision=7) I get `color(xyz-d50 0.083139 0.154748 0.020956)` which, back-converted, is `rgb(-0.00088% 50.19617% -0.00018%)` - closer, still shows round-off error though. I suspect the chromatic adaptation is the culprit here.

> Running the transformation with lossless rationals yields `color(xyz-d50 0.08313899747975508 0.15474758917173437 0.02095602320031179)`, which would round to `color(xyz-d50 0.08314 0.154748 0.020956).` 

That is very close to what I got with the current color.js, which is not using the rational form.

-- 
GitHub Notification of comment by svgeesus
Please view or discuss this issue at https://github.com/w3c/csswg-drafts/issues/7675#issuecomment-1270383417 using your GitHub account


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

Received on Thursday, 6 October 2022 16:37:04 UTC