/* https://grabient.com/_gD3gGcgAsgTRgSzgFPgAjgA3gA4gbVhZrglT?style=linearGradient&steps=10&angle=75 */
background: linear-gradient(75deg, #3d5400 0.000%, #456000 11.111%, #4c6b00 22.222%, #547700 33.333%, #5c8300 44.444%, #638f00 55.556%, #6b9a00 66.667%, #73a600 77.778%, #7ab100 88.889%, #82bd00 100.000%);
<svg xmlns="http://www.w3.org/2000/svg" width="800" height="400" viewBox="0 0 800 400" preserveAspectRatio="none">
<!-- https://grabient.com/_gD3gGcgAsgTRgSzgFPgAjgA3gA4gbVhZrglT?style=linearGradient&steps=10&angle=75 -->
<defs>
<linearGradient id="gradient" x1="0.017" y1="0.629" x2="0.983" y2="0.371">
<stop offset="0.000" stop-color="#3d5400" /><stop offset="0.111" stop-color="#456000" /><stop offset="0.222" stop-color="#4c6b00" /><stop offset="0.333" stop-color="#547700" /><stop offset="0.444" stop-color="#5c8300" /><stop offset="0.556" stop-color="#638f00" /><stop offset="0.667" stop-color="#6b9a00" /><stop offset="0.778" stop-color="#73a600" /><stop offset="0.889" stop-color="#7ab100" /><stop offset="1.000" stop-color="#82bd00" />
</linearGradient>
</defs>
<rect x="0" y="0" width="800" height="400" fill="url(#gradient)" />
</svg>
["#3d5400", "#456000", "#4c6b00", "#547700", "#5c8300", "#638f00", "#6b9a00", "#73a600", "#7ab100", "#82bd00"]
// https://grabient.com/_gD3gGcgAsgTRgSzgFPgAjgA3gA4gbVhZrglT?style=linearGradient&steps=10&angle=75
// cosine gradient palette — https://iquilezles.org/articles/palettes/
const float STEPS = 10.0;
const float ANGLE = 75.0;
vec3 palette(float t) {
vec3 a = vec3(0.247, 0.412, 0.044);
vec3 b = vec3(1.233, 1.203, 0.335);
vec3 c = vec3(0.035, 0.055, 0.056);
vec3 d = vec3(1.749, 5.739, 2.387);
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.247, 0.412, 0.044],
[1.233, 1.203, 0.335],
[0.035, 0.055, 0.056],
[1.749, 5.739, 2.387]
]