[css-houdini-drafts] [css-typed-om] Move ".colorspace" to the color superclass, readonly (#1036)

tabatkins has just created a new issue for https://github.com/w3c/css-houdini-drafts:

== [css-typed-om] Move ".colorspace" to the color superclass, readonly ==
In <https://github.com/w3c/css-houdini-drafts/issues/1034#issuecomment-840494082>, Lea points out that it's annoying to figure out what the colorspace of a color object is. 

We already have precedent in Typed OM for helping with this - the math function subclasses expose their function name as a property as well, precisely to avoid this annoying hacky work.

Seems like the most straightforward fix is to move ".colorspace" to the `CSSColorValue` superclass, as a readonly property that's automatically set to the corresponding function name, and then make it writable on `CSSColor`.

(Conveniently, the CSSWG just resolved to drop the "lab" predefined color space for color(), so there's no clashes anymore. "rgb" (for `rgb()`) and "srgb" (for `color(srgb)`) will be *close*, but they're distinct.)

Please view or discuss this issue at https://github.com/w3c/css-houdini-drafts/issues/1036 using your GitHub account


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

Received on Thursday, 13 May 2021 14:59:29 UTC