Colour · gradientCSS gradient generator
Build a linear, radial or conic gradient by dragging colour stops and copy ready CSS. With a text readability check and a hint when the transition turns muddy.
Runs in your browser
01
Builder
move the stops — the CSS follows at once02
Text readability
WCAG contrast along the whole gradient, not at one point03
Recipes
ready code and a live example — in your colours04
About gradients
A CSS gradient is a smooth transition between colours. You set two things: a direction (an angle, a centre or a sector) and colour stops — colours with optional positions. The browser works out the rest, and how it blends the colours decides whether the transition comes out clean or muddy.
Three types
Basicslinear · radial · conic
A linear gradient carries colour along a line, a radial one outwards from the centre, a conic one around the centre. Conic gradients are used for charts and colour wheels.
Colour stops
Stops#f00 0%, #00f 100%
Each stop is a colour and a position. Two stops at the same position make a hard edge — that is how stripes and two-tone backgrounds are made without images.
The dead grey zone
Problemblue → yellow
With ordinary blending, a transition between opposite colours sinks into muddy grey. It is not a browser bug but a property of sRGB.
OKLCH to the rescue
Fixin oklch
Adding in oklch makes the browser blend in a perceptual space: the transition stays clean and even in lightness.
Text on top
Accessibilityworst point
Text on a gradient reads differently in different places: where the background lightens, contrast may drop below the norm. Check the whole length, not one colour.
Banding
Print and screendithering
Large smooth transitions show visible steps. A light noise over the gradient or more contrasting colours help.
05
Frequently asked
Updated