Re: [csswg-drafts] [css-color-4] Conversion precision for hue in LCH model creates false results (#5309)

> In library I work on I've set precision such as converting lab(100% 0 0) to XYZ would give me exactly value of D50 ([0.96422, 1, 0.82521]) and converting rgb(100% 100% 100%) to XYZ would give me exactly value of D65 ([0.95047, 1, 1.08883])* and this alone solved all conversion inconsistencies I had.

We have [the same in color.js](https://github.com/LeaVerou/color.js/blob/c78e6657600f092126eed865ab03fcb51355c075/src/color.js#L948-L951)
```js
 whites: {
  D50: [0.96422, 1.00000, 0.82521],
  D65: [0.95047, 1.00000, 1.08883],
 },
```

The sample code in the specification is intended to be clear, simple and easy to read. Production code needs more error checking and handling of corner cases.

I should really add the `NaN` on hue angle though, since the specification now mentions it.

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


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

Received on Friday, 27 November 2020 16:49:42 UTC