Commit bc1af6c
Change the
Since [Chrome 111](https://developer.mozilla.org/en-US/docs/Web/CSS/hue-interpolation-method#browser_compatibility), CSS gradients support `<hue-interpolation-method>`. This allows us to implement hue gradients in color pickers very accurately.
Previously we could only simulate this by adding multiple color-stops.
```css
.spectrum-hue {
background: linear-gradient(to left, #f00 0%, #ff0 17%, #0f0 33%, #0ff 50%, #00f 67%, #f0f 83%, #f00 100%);
}
```
Now it's just a simple matter of:
```css
.spectrum-hue {
background: linear-gradient(to left in hsl longer hue, red 0 100%);
}
```
This is the best practice for generating rainbow 🌈 gradients in the future.
Fixed: 402346402
Change-Id: I43399c40bc68c167bfac0e9d0ce76d3cf37cfe91
Reviewed-on: https://chromium-review.googlesource.com/c/devtools/devtools-frontend/+/6342933
Commit-Queue: Changhao Han <[email protected]>
Reviewed-by: Changhao Han <[email protected]>spectrum gradient in the color picker to <hue-interpolation-method>
1 parent 2dbcb22 commit bc1af6c
1 file changed
+2
-2
lines changed| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
72 | 72 | | |
73 | 73 | | |
74 | 74 | | |
75 | | - | |
| 75 | + | |
76 | 76 | | |
77 | 77 | | |
78 | 78 | | |
79 | | - | |
| 79 | + | |
80 | 80 | | |
81 | 81 | | |
82 | 82 | | |
| |||
0 commit comments