How to use it
- Choose the type
Linear runs in one direction, radial spreads from a point, conic sweeps around it.
- Edit the colour stops
Add up to eight colours and set where each one sits, from 0% to 100%.
- Copy the CSS
The code includes a solid colour and an sRGB fallback for older browsers.
Why gradients turn grey in the middle
By default browsers blend gradient colours in sRGB. Between two saturated colours on opposite sides of the colour wheel, such as blue and yellow, the halfway point in sRGB is a dull grey. Choosing OKLCH or OKLab interpolation keeps the middle bright: OKLCH travels around the hue wheel, OKLab goes straight across but keeps the lightness even.
The in oklch syntax works in current Chrome, Edge, Safari and Firefox. Older browsers ignore that line, so the generated code puts an ordinary sRGB gradient first as a fallback, and a solid colour before that.
The three gradient types
- linear-gradient: colours change along a straight line. 0deg goes up, 90deg goes right, 180deg goes down.
- radial-gradient: colours spread out from a centre point as a circle or an ellipse that fits the box.
- conic-gradient: colours sweep around a centre point, like a pie chart or a colour wheel.
Turn on repeat and set the last stop below 100% to get stripes, rings or sunbursts.
Text on a gradient
If you place text on top, check it against both the lightest and the darkest stop with the contrast checker. Need a colour in another format first? Use the colour converter.