W3C home > Mailing lists > Public > public-css-archive@w3.org > June 2020

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

From: Igor Snitkin via GitHub <sysbot+gh@w3.org>
Date: Thu, 25 Jun 2020 21:04:25 +0000
To: public-css-archive@w3.org
Message-ID: <issue_comment.created-649816625-1593119064-sysbot+gh@w3.org>
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:
(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

This archive was generated by hypermail 2.4.0 : Tuesday, 5 July 2022 06:42:09 UTC