-
Notifications
You must be signed in to change notification settings - Fork 689
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] Should color-mix()
default to oklab interpolation?
#10484
Comments
I have seen that many times. One talk at CSS Day (on a different subject, but happened to use
An explicit choice to make authors think about which space to use, if no help if they can't choose or are working from incorrect assumptions. |
So, although I originally argued against this, I think that requiring an explicit colorspace is not helping. |
It also doesn't help that it isn't documented for authors... This doesn't explain what the purpose is of having a color space argument. Edit : filed an issue mdn/content#34351 |
To quote my comment there:
If anything, this MDN page highlights precisely why we need a default here. |
|
Hm, does that mean we should default to |
No, we should (continue to) default to the most useful and desired option, which is perceptually uniform mixing. In other words a 50-50 mix of two colors gives the color that looks half way between them. Linear in light intensity is not often needed (compositing is one case where it would be useful, because there the color from one is indeed shining through another, partially transparent, color). |
What about other interpolations like transitions/animations? Should all of them be consistent? |
If we default to Oklab for |
In #7948 we resolved that gradients should interpolate in oklab by default. This introduces an inconsistency between gradients and
color-mix()
, since the latter requires an interpolation space. At the time we did not want to introduce a default, but I think we’re now confident enough that OkLab would be a good default. Not only does having to type an interpolation method every time makecolor-mix()
tedious to use (tediosity that is multiplied when it’s nested), but also most authors don’t really understand color spaces, and tend to usein srgb
as that’s familiar, which produces the worst interpolation they could possibly get.The text was updated successfully, but these errors were encountered: