Re: [csswg-drafts] [css-color4] Precision issues when converting colors between Lab and sRGB (#5262)

I found it super confusing to store everything in one class and ended up implementing 3 classes: each for sRGB, Lab and XYZ color spaces with default D65 white point for sRGB, D50 for Lab and toggleable white point for XYZ using Bradford adaptation. Here's the repo:
https://github.com/snigo/color
(early stage without description at this point)

I've increased rounding from 3 to 7 decimal places and everything works perfectly fine now. 👍
The problem in particular was with Lightness of Lab which I stored as decimal in [0..1] range and in this way rounding to 3 places is not enough

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

Received on Thursday, 25 June 2020 21:04:27 UTC