1

Which color space does CSS's linear-gradient() function uses, RGB, HSL or HSV and why ?

Can I change the color space of my own choice ?

entropyfeverone
  • 1,052
  • 2
  • 8
  • 20

2 Answers2

1

In the future you can specify the color space

Compared to [css3-images], this level adds a token to customize color interpolation in gradients as described in CSS Color 4 § 12 Interpolation.

linear-gradient() = linear-gradient(
  [ <angle> | to <side-or-corner> ]? || <color-interpolation-method>,
  <color-stop-list>
)
<side-or-corner> = [left | right] || [top | bottom]

You can keep reading for more detail


Safari has some support for this if you want to test: https://twitter.com/argyleink/status/1490376117064065025

Temani Afif
  • 245,468
  • 26
  • 309
  • 415
-1

i don't know about HSL Or HSV but when i trying to use liner-gradient() function i go with and yes you can change the color space of own