/* https://grabient.com/_gMggJYgGQgJYgGQgDIgEsgDIgBkgAAgFKgKe?style=linearGradient&steps=10&angle=120 */
background: linear-gradient(120deg, #ff684d 0.000%, #ff5c51 11.111%, #ff5154 22.222%, #ff4857 33.333%, #ff405b 44.444%, #ff3a5e 55.556%, #fb3662 66.667%, #dc3365 77.778%, #bc3369 88.889%, #9d356c 100.000%);
<svg xmlns="http://www.w3.org/2000/svg" width="800" height="400" viewBox="0 0 800 400" preserveAspectRatio="none">
<!-- https://grabient.com/_gMggJYgGQgJYgGQgDIgEsgDIgBkgAAgFKgKe?style=linearGradient&steps=10&angle=120 -->
<defs>
<linearGradient id="gradient" x1="0.067" y1="0.250" x2="0.933" y2="0.750">
<stop offset="0.000" stop-color="#ff684d" /><stop offset="0.111" stop-color="#ff5c51" /><stop offset="0.222" stop-color="#ff5154" /><stop offset="0.333" stop-color="#ff4857" /><stop offset="0.444" stop-color="#ff405b" /><stop offset="0.556" stop-color="#ff3a5e" /><stop offset="0.667" stop-color="#fb3662" /><stop offset="0.778" stop-color="#dc3365" /><stop offset="0.889" stop-color="#bc3369" /><stop offset="1.000" stop-color="#9d356c" />
</linearGradient>
</defs>
<rect x="0" y="0" width="800" height="400" fill="url(#gradient)" />
</svg>
["#ff684d", "#ff5c51", "#ff5154", "#ff4857", "#ff405b", "#ff3a5e", "#fb3662", "#dc3365", "#bc3369", "#9d356c"]
// https://grabient.com/_gMggJYgGQgJYgGQgDIgEsgDIgBkgAAgFKgKe?style=linearGradient&steps=10&angle=120
// cosine gradient palette — https://iquilezles.org/articles/palettes/
const float STEPS = 10.0;
const float ANGLE = 120.0;
vec3 palette(float t) {
vec3 a = vec3(0.800, 0.600, 0.400);
vec3 b = vec3(0.600, 0.400, 0.200);
vec3 c = vec3(0.300, 0.200, 0.100);
vec3 d = vec3(0.000, 0.330, 0.670);
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.800, 0.600, 0.400],
[0.600, 0.400, 0.200],
[0.300, 0.200, 0.100],
[0.000, 0.330, 0.670]
]