Re: [csswg-drafts] CSS color serialization and <input type=color> with alpha/colorspace (#11008)

> So the main question is what happens when the HTML-compatible directive is not set (i.e., when the `alpha` attribute is set).

You probably already know this and just simplified for brevity, but since you are prototyping an implementation I felt the need to point out that non-unity alpha is only one of the cases that means `#rrggbb` is not used. The [other is](https://drafts.csswg.org/css-color-4/#HTML-compatible-serialization-of-srgb):

> The RGB component values are internally represented as integers between 0 and 255 inclusive (i.e. 8-bit unsigned integer) 

Which means that extended-range sRGB will not use the hex serialization, either. For example [`color(srgb -0.41 0.92 -0.18)`](https://apps.colorjs.io/convert/?color=color(srgb%20-0.41%200.92%20-0.18)&precision=4) is not representable with 8 bits per component due to the negative values.

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


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

Received on Thursday, 10 October 2024 17:59:41 UTC