Re: [csswg-drafts] [css-color-4] HTML needs an html-compatible, hex serialization of 8 bit/component sRGB colors (#10550)

> This sRGB section also doesn't address mapping "none" to 0, but it probably should?

Because it is not specific to sRGB. It is defined in [4.4. “Missing” Color Components and the `none` Keyword](https://drafts.csswg.org/css-color-4/#missing):

> If a color with a [missing component](https://drafts.csswg.org/css-color-4/#missing-color-component) is serialized or otherwise presented directly to an author, then for [legacy color syntax](https://drafts.csswg.org/css-color-4/#legacy-color-syntax) it represents that component as a zero value; otherwise, it represents that component as being the [none](https://drafts.csswg.org/css-color-4/#valdef-color-none) keyword.

Hex colors are a legacy color syntax. `color(whatever r g b / alpha)` is a modern syntax.

But then, [5.2.2. CSS serialization of sRGB values](https://drafts.csswg.org/css-color-4/#css-serialization-of-srgb) does reiterate it:

> During serialization, any [missing](https://drafts.csswg.org/css-color-4/#missing-color-component) values are converted to 0.

So maybe the `htmlCompatible` serialization should also say that, for sRGB values.

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


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

Received on Thursday, 15 August 2024 12:54:43 UTC