What changes in the middle?
sRGB mixes the encoded red, green and blue channels. OKLab mixes perceptual lightness and two opponent-color axes. OKLCH mixes lightness, chroma and hue along the shorter hue arc. It often avoids a dull middle between saturated colors, but cannot guarantee it for every pair. For neutral colors and transparency fades, try OKLab first.
A worked color example
In sRGB, halfway between red (#ff0000) and blue (#0000ff) is rgb(127.5 0 127.5), rounded to #800080. An angle of 90° runs left to right; −90° normalizes to 270°. A 25% stop is one quarter of the gradient line, not necessarily one quarter of the image width.
How exports are calculated
For channel c, ordinary mixing is c(t) = (1 − t)c₀ + tc₁. With transparency, non-hue channels are multiplied by alpha before mixing, then divided by the mixed alpha. OKLab uses Björn Ottosson’s published 2021 matrices; OKLCH uses C = √(a² + b²), h = atan2(b, a), and the shortest hue arc. Out-of-sRGB colors are clipped for PNG and fallback stops. Stops sort by position, clamp to 0–100%, and identical positions keep the last color.
PNG is calculated at pixel centers using a 4,097-sample color lookup, with a circular farthest-corner radial shape. Browser gamut mapping, rounding and antialiasing can differ slightly. SVG uses 32 samples per interval; conic SVG is a 720-wedge vector approximation and may show fine seams. CSS fallback adds eight subdivisions per interval. These are approximations, not exact pixel matches.
Modern CSS and older browsers
The output explicitly declares its mixing space, such as linear-gradient(90deg in oklch shorter hue, …). Enable the fallback to place a sampled sRGB declaration first, so browsers that reject the newer line keep the earlier one. Check current support in MDN’s linear-gradient compatibility table and Can I Use: gradient interpolation; we do not promise a minimum browser version. The editor itself displays a sampled fallback when interpolation syntax is unavailable.
Sources: A perceptual color space for image processing, Björn Ottosson and W3C CSS Color 4. Your gradient stays in your browser. Share links include its colors and settings in the address.