New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
[css-typed-om] Move ".colorspace" to the color superclass, readonly #1036
Comments
If we have this, then it also gives us an identifier we can use to make the This would solve another problem Lea pointed out in the comment linked above, and would make it more consistent with the |
That would be much better, yes. It should be noted that the domain and range are unbounded, so that there is no hidden clipping or gamut mapping, when converting from one space to another (i.e. you can convert back without loss). |
So, the only object that allows this type of colorspace conversion is And, there is both |
No, it would be on
Yup. |
I support this change and think it's an improvement over the current API, though |
In #1034 (comment), 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 onCSSColor
.(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" (forcolor(srgb)
) will be close, but they're distinct.)The text was updated successfully, but these errors were encountered: