Skip to content
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] in <space> syntax for linear-gradient() et al #6667

Closed
surma opened this issue Sep 22, 2021 · 3 comments
Closed

[css-color-5] in <space> syntax for linear-gradient() et al #6667

surma opened this issue Sep 22, 2021 · 3 comments

Comments

@surma
Copy link
Member

surma commented Sep 22, 2021

The nice thing about color-mix() is that it allows you to specify colors in a different color space then the color space in which the interpolation happens. As far as I can tell, linear-gradient() et al will always interpolate in RGB space, and I can’t find any changes to linear-gradient in CSS Color 4 or 5. Would it be feasible to add a in <space> syntax to linear-gradient(), similar to what color-mix() supports?

Here’s what gradients from blue to green would look like (I used JavaScript to generate these gradients using color-mix()):

Screen Shot 2021-09-22 at 16 31 00

cc @argyleink

@svgeesus
Copy link
Contributor

Yes, there should totally be an in colorspace keyword added to gradients, to override the current sRGB default for legacy colors.

I think this is already discussed in Consider allowing gradients to include a color space for interpolation to take place in and also Don't force non-legacy colors to interpolate in a gamma-encoded space and Question: in what color space will gradient interpolation occur?

But that change would happen in CSS Images 4, not in Color 4 or 5.

@surma
Copy link
Member Author

surma commented Sep 24, 2021

Ah good to know. If it’s already decided, then I’m happy to let this be closed.

@svgeesus
Copy link
Contributor

Sadly there is a lag between "already decided" and "already in the spec" and you should not be required to be psychic or have attended every call for the last 5 years.

So I'm going to re-tag it to Images 4, and leave it open until done.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

3 participants