Re: [csswg-drafts] [css-images-4] is serialization from named colors to rgb values is mandatory in general (#7728)

So I just discussed this with @emilio  and we concluded, looking at the `<color>` section in [ Serializing CSS Values](https://w3c.github.io/csswg-drafts/cssom-1/#serializing-css-values), that almost all of this has been moved over to CSS Color 4 which makes it super easy to miss the small parts that are left. So its better to move over the rest too, so it is all in one place.

Currently, CSSOM says

> If [<color>](https://w3c.github.io/csswg-drafts/css-color-4/#typedef-color) is a component of a specified value, then return the color as follows:
>
> 1.    If the color was explicitly specified by the author, then return the original, author specified color value.
> 2.    Otherwise, return the value that would be returned if the color were a component of a computed value.

And the trouble is that point 1. is not correct and not what browsers do. Instead it should be:

1. If the color was explicitly specified by the author as a named color, then return the original, author specified named color value.

So the specified value of `papayaWhip` is `papayawhip` and the computed value is `rgb(255, 239, 213 )`



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


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

Received on Tuesday, 13 September 2022 20:55:53 UTC