Re: [csswg-drafts] [css-images-4] Clarifying CSS gradient rendering for edge cases involving "longer hue" interpolation (#11381)

> How are authors supposed to write "longer hue" gradients with sections of solid color?

Unfortunately, there isn't really a way using "longer" as it always force the interpolation path to take the longer arc.

I personally always thought this to be a great case for undefined hues, but that only works if you resolve the undefined hue post-interpolation. CSS chose to resolve the hue pre-interpolation. Resolving before interpolation creates two defined hues with a long arc traveling 360 degrees. I always thought it odd to treat an interpolation of an undefined and defined hue as having an arc, but I lost that argument 🙂.

I personally chose to treat the CSS approach as its own thing so I could utilize undefined hues in a non-CSS approach that seemed more intuitive (at least to me).

![Image](https://github.com/user-attachments/assets/18a89fac-233c-4c96-8d5e-0f72fe092d94)

I think inteprolation between two identical defined hues creating a rainbow should be expected. It's actually an easy way to create rainbow gradients.

-- 
GitHub Notification of comment by facelessuser
Please view or discuss this issue at https://github.com/w3c/csswg-drafts/issues/11381#issuecomment-2938444027 using your GitHub account


-- 
Sent via github-notify-ml as configured in https://github.com/w3c/github-notify-ml-config

Received on Wednesday, 4 June 2025 04:29:06 UTC