/* https://grabient.com/_gEpgF3gFOgJBgJzgR4gFKgDFgBJggugCtgVQefvovjZN?style=linearGradient&steps=13&angle=180 */
background: linear-gradient(180deg, #003bff 0.000%, #004bff 8.333%, #125cff 16.667%, #2b6cff 25.000%, #447bff 33.333%, #5d8bff 41.667%, #7499ff 50.000%, #8aa7ff 58.333%, #9db3ff 66.667%, #adbfff 75.000%, #b9c9ff 83.333%, #c2d2ff 91.667%, #c6d9ff 100.000%);
<svg xmlns="http://www.w3.org/2000/svg" width="800" height="400" viewBox="0 0 800 400" preserveAspectRatio="none">
<!-- https://grabient.com/_gEpgF3gFOgJBgJzgR4gFKgDFgBJggugCtgVQefvovjZN?style=linearGradient&steps=13&angle=180 -->
<defs>
<linearGradient id="gradient" x1="0.500" y1="0.000" x2="0.500" y2="1.000">
<stop offset="0.000" stop-color="#003bff" /><stop offset="0.083" stop-color="#004bff" /><stop offset="0.167" stop-color="#125cff" /><stop offset="0.250" stop-color="#2b6cff" /><stop offset="0.333" stop-color="#447bff" /><stop offset="0.417" stop-color="#5d8bff" /><stop offset="0.500" stop-color="#7499ff" /><stop offset="0.583" stop-color="#8aa7ff" /><stop offset="0.667" stop-color="#9db3ff" /><stop offset="0.750" stop-color="#adbfff" /><stop offset="0.833" stop-color="#b9c9ff" /><stop offset="0.917" stop-color="#c2d2ff" /><stop offset="1.000" stop-color="#c6d9ff" />
</linearGradient>
</defs>
<rect x="0" y="0" width="800" height="400" fill="url(#gradient)" />
</svg>
["#003bff", "#004bff", "#125cff", "#2b6cff", "#447bff", "#5d8bff", "#7499ff", "#8aa7ff", "#9db3ff", "#adbfff", "#b9c9ff", "#c2d2ff", "#c6d9ff"]
// https://grabient.com/_gEpgF3gFOgJBgJzgR4gFKgDFgBJggugCtgVQefvovjZN?style=linearGradient&steps=13&angle=180
// cosine gradient palette — https://iquilezles.org/articles/palettes/
const float STEPS = 13.0;
const float ANGLE = 180.0;
vec3 palette(float t) {
vec3 a = vec3(0.200, 0.278, 0.237);
vec3 b = vec3(0.577, 0.627, 1.144);
vec3 c = vec3(0.328, 0.196, 0.073);
vec3 d = vec3(1.659, -0.262, 0.925);
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.200, 0.278, 0.237],
[0.577, 0.627, 1.144],
[0.328, 0.196, 0.073],
[1.659, -0.262, 0.925]
]