W3C home > Mailing lists > Public > public-css-archive@w3.org > January 2021

Re: [csswg-drafts] [css-color-4] What serialization should be used when using color(lab ...) syntax to specify a lab color? (#5825)

From: Chris Lilley via GitHub <sysbot+gh@w3.org>
Date: Wed, 20 Jan 2021 15:57:22 +0000
To: public-css-archive@w3.org
Message-ID: <issue_comment.created-763730830-1611158241-sysbot+gh@w3.org>
> For `color(srgb ...)`

>    we store the color internally as sRGB-FFFF
>    we serialize as `color(srgb ...)`

There are two options here:

**Option 1: continue to serialize `color(srgb r g b)` and `color( r g b)` as `color(srgb r g b)`**

where r, g and b are numbers in the 0 to 1 range. This is the current spec text.

**Option 2: serialize `color(srgb r g b)` and `color( r g b)` as `color(r g b)`**

Noting that the colorspace name, if omitted, defaults to sRGB. This is shorter than option 1, but continues to use the new syntax for the new syntactic form and the legacy syntax for the legacy `rgb()` etc. forms. 

Spec-wise, serialization of `rgb()` and `color(srgb)` currently _both_ require a minimum of 8 bits per component. But we could, if desired, increase the precision requirement for `color(srgb)` to guarantee that more of the specified precision is kept. And perhaps, accept that the legacy forms are mostly rounding (or in some cases truncating, which is bad and not per-spec) the values to 8bit, even for the percentage forms `rgb(% % %)` and `rgb(% % %)`

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

Sent via github-notify-ml as configured in https://github.com/w3c/github-notify-ml-config
Received on Wednesday, 20 January 2021 15:57:25 UTC

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