/* https://grabient.com/_gEygDxgFlgCpgCygDmgTkgPUgi0gAxgK-gDR?style=linearGradient&steps=11&angle=225 */
background: linear-gradient(225deg, #77306a 0.000%, #624b26 10.000%, #41623a 20.000%, #286b85 30.000%, #25638a 40.000%, #3a4e41 50.000%, #5b3223 60.000%, #741b62 70.000%, #771096 80.000%, #611668 90.000%, #402b25 100.000%);
<svg xmlns="http://www.w3.org/2000/svg" width="800" height="400" viewBox="0 0 800 400" preserveAspectRatio="none">
<!-- https://grabient.com/_gEygDxgFlgCpgCygDmgTkgPUgi0gAxgK-gDR?style=linearGradient&steps=11&angle=225 -->
<defs>
<linearGradient id="gradient" x1="0.854" y1="0.146" x2="0.146" y2="0.854">
<stop offset="0.000" stop-color="#77306a" /><stop offset="0.100" stop-color="#624b26" /><stop offset="0.200" stop-color="#41623a" /><stop offset="0.300" stop-color="#286b85" /><stop offset="0.400" stop-color="#25638a" /><stop offset="0.500" stop-color="#3a4e41" /><stop offset="0.600" stop-color="#5b3223" /><stop offset="0.700" stop-color="#741b62" /><stop offset="0.800" stop-color="#771096" /><stop offset="0.900" stop-color="#611668" /><stop offset="1.000" stop-color="#402b25" />
</linearGradient>
</defs>
<rect x="0" y="0" width="800" height="400" fill="url(#gradient)" />
</svg>
["#77306a", "#624b26", "#41623a", "#286b85", "#25638a", "#3a4e41", "#5b3223", "#741b62", "#771096", "#611668", "#402b25"]
// https://grabient.com/_gEygDxgFlgCpgCygDmgTkgPUgi0gAxgK-gDR?style=linearGradient&steps=11&angle=225
// cosine gradient palette — https://iquilezles.org/articles/palettes/
const float STEPS = 11.0;
const float ANGLE = 225.0;
vec3 palette(float t) {
vec3 a = vec3(0.306, 0.241, 0.357);
vec3 b = vec3(0.169, 0.178, 0.230);
vec3 c = vec3(1.252, 0.980, 2.228);
vec3 d = vec3(0.049, 0.702, 0.209);
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.306, 0.241, 0.357],
[0.169, 0.178, 0.230],
[1.252, 0.980, 2.228],
[0.049, 0.702, 0.209]
]