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-color-5] Consider always requiring a colorspace argument to color-mix() #6051
Comments
I'm ok with requiring a default for now, with the explicit intent of removing it later. |
Yeah, requiring a color space also avoids deciding what the right default should be. I'd note that colors-4 says that:
It's not clear which of the two defaults wins here, and personally I think it'd be a bit weird if |
@emilio That is the crappy legacy behavior which is there for no other reason besides web compat (and should probably use a "may"). There is no other reason other than web compat to interpolate or composit anything in gamma-encoded sRGB so we should not repeat that mistake in anything new that we produce. |
I agree, but thus I think being explicit at least for now is better :) |
@una @svgeesus @argyleink do you agree? If so I could make that change along with the others. |
looks good to me 🙂 |
I agree. |
In the current CSS Color 5 draft's color-mix() function, https://drafts.csswg.org/css-color-5/#color-mix, the colorspace is argument is optional, and leaving it out defaults to "lch".
I would like to suggest we remove the default value and always require a colorspace to specified. In general, I think requiring explicit color spaces is beneficial to avoid circumstances like we have now with implicit sRGB, where the best choice is no longer what we think it is. If in the past, we had required all colors / transformations of colors to be tagged, it would be much easier to change things today, as finding all the uses of sRGB in a codebase would be just searching for that explicit usage.
It's always possible to add a default later, if it becomes a burden, but it is much harder to remove one, so I think being conservative for now is the right tradeoff to make.
The text was updated successfully, but these errors were encountered: