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

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

From: Chris Lilley via GitHub <sysbot+gh@w3.org>
Date: Fri, 27 Nov 2020 16:49:41 +0000
To: public-css-archive@w3.org
Message-ID: <issue_comment.created-734918327-1606495780-sysbot+gh@w3.org>
> 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)
	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

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