Re: [csswg-drafts] [css-color-4] Gamut Mapping Clarifications (#9651)

They should be the same up to ~32 bit precision. Changes in the matrix are mainly out in the 64 bit portion.

You can see, the inverse matrix before just had garbage in the 64bit portion:

```js
const LabtoLMS_M = [
 [ 0.99999999845051981432,  0.39633779217376785678,   0.21580375806075880339  ],
 [ 1.0000000088817607767,  -0.1055613423236563494,   -0.063854174771705903402 ],
 [ 1.0000000546724109177,  -0.089484182094965759684, -1.2914855378640917399   ]
];
```

Now the new matrix will give you a proper LMS of [1, 1, 1] for `oklab(1 0 0)` which matches the the XYZ to LMS portion of the transform. Before, this was off for 64bit values, which is why all achromatics had garbage in the 64bit part.

```js
const LabtoLMS_M = [
 [ 1.0000000000000000,  0.3963377773761749,  0.2158037573099136 ],
 [ 1.0000000000000000, -0.1055613458156586, -0.0638541728258133 ],
 [ 1.0000000000000000, -0.0894841775298119, -1.2914855480194092 ]
];
```

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


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

Received on Monday, 18 December 2023 14:52:27 UTC