/* https://grabient.com/_gKdgKIgHUgD6gEPgG9gNKglVgOygFOgBBgNp?style=linearGradient&steps=10&angle=225 */
background: linear-gradient(225deg, #8ae5c7 0.000%, #7184e8 11.111%, #6b6cda 22.222%, #7bd2a2 33.333%, #9ad659 44.444%, #bf6f1c 55.556%, #dd7f06 66.667%, #eae21f 77.778%, #e2bf5e 88.889%, #c763a7 100.000%);
<svg xmlns="http://www.w3.org/2000/svg" width="800" height="400" viewBox="0 0 800 400" preserveAspectRatio="none">
<!-- https://grabient.com/_gKdgKIgHUgD6gEPgG9gNKglVgOygFOgBBgNp?style=linearGradient&steps=10&angle=225 -->
<defs>
<linearGradient id="gradient" x1="0.854" y1="0.146" x2="0.146" y2="0.854">
<stop offset="0.000" stop-color="#8ae5c7" /><stop offset="0.111" stop-color="#7184e8" /><stop offset="0.222" stop-color="#6b6cda" /><stop offset="0.333" stop-color="#7bd2a2" /><stop offset="0.444" stop-color="#9ad659" /><stop offset="0.556" stop-color="#bf6f1c" /><stop offset="0.667" stop-color="#dd7f06" /><stop offset="0.778" stop-color="#eae21f" /><stop offset="0.889" stop-color="#e2bf5e" /><stop offset="1.000" stop-color="#c763a7" />
</linearGradient>
</defs>
<rect x="0" y="0" width="800" height="400" fill="url(#gradient)" />
</svg>
["#8ae5c7", "#7184e8", "#6b6cda", "#7bd2a2", "#9ad659", "#bf6f1c", "#dd7f06", "#eae21f", "#e2bf5e", "#c763a7"]
// https://grabient.com/_gKdgKIgHUgD6gEPgG9gNKglVgOygFOgBBgNp?style=linearGradient&steps=10&angle=225
// cosine gradient palette — https://iquilezles.org/articles/palettes/
const float STEPS = 10.0;
const float ANGLE = 225.0;
vec3 palette(float t) {
vec3 a = vec3(0.669, 0.648, 0.468);
vec3 b = vec3(0.250, 0.271, 0.445);
vec3 c = vec3(0.842, 2.389, 0.946);
vec3 d = vec3(0.334, 0.065, 0.873);
return a + b * cos(6.283185 * (c * t + d));
}
// N stops sampled from the palette, blended like the CSS gradient
vec3 stops(float t) {
float n = STEPS - 1.0;
float x = clamp(t, 0.0, 1.0) * n;
return mix(palette(floor(x) / n), palette(min(floor(x) + 1.0, n) / n), fract(x));
}
void mainImage(out vec4 fragColor, in vec2 fragCoord) {
vec2 p = fragCoord - 0.5 * iResolution.xy;
// CSS angle: 0 = up, clockwise; span = CSS gradient-line length
vec2 dir = vec2(sin(radians(ANGLE)), cos(radians(ANGLE)));
float len = abs(iResolution.x * dir.x) + abs(iResolution.y * dir.y);
float t = dot(p, dir) / len + 0.5;
fragColor = vec4(stops(t), 1.0);
}
[
[0.669, 0.648, 0.468],
[0.250, 0.271, 0.445],
[0.842, 2.389, 0.946],
[0.334, 0.065, 0.873]
]