-
Notifications
You must be signed in to change notification settings - Fork 143
CSSColorValue.colorSpace restricts naming of future color functions and color() keywords #1070
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
Comments
Yeah we keep going back and forth about which or even whether color functions should be representable in But let's step back for a bit. Do we actually need a |
This follows naturally from the design decision in Typed OM that retaining and exposing the syntax is the most important thing (thus, lots of different ways to specify an sRGB color), while in the Color object exposing the values and the colorspace is the key thing. And thus, conversion to sRGB in the Color object does not need to have options to pick which of the many syntaxes you get. I agree with Lea that handling color conversions based on fully resolved values in the |
I've let this sit overnight, and I think I can agree with y'all. Assuming work continues on That'll make this issue moot, then. Thanks! |
…ersion isn't really in Typed OM's remit. #1070
Chris and I definitely intend to continue working on it (for me as time allows, unless I can get sponsorship for this work), but I will point out you can also pitch in to the work as a co-editor 😉 |
If I had the time to work on everything I had interest in.... |
I know the feeling 😕 |
CSSColorValue exposes a
.colorSpace
attribute and a.to(colorSpace)
method, which use the same set of strings. Forcolor()
functions, the corresponding string is the color space keyword; for the other color functions, the corresponding string is the function name.These two sets of names aren't guaranteed to be distinct! Currently, there's no overlap, but there was in a previous revision to the spec when
color(lab ...)
was allowed.@svgeesus and @LeaVerou, do you think restricting these two sets to be non-overlapping in the future is reasonable? Or do you think it's plausible we may want to have such an overlap? If the latter, I think the easiest solution for this is to use parens at the end of the string for the function names, so
CSSRGB.colorSpace
would return"rgb()"
, you'd callc.to("rgb()")
, etc. Thoughts?The text was updated successfully, but these errors were encountered: