CSS gradient generator
Pick colours and an angle, see the gradient live, and copy the CSS. Turn on OKLCH blending for smoother, brighter middles.
Linear, radial and conic gradients
- Linear blends along a straight line. 90° runs left to right, 180° top to bottom, 135° diagonally.
- Radial spreads out in a circle from the centre, good for soft glows and spotlights.
- Conic sweeps around a centre point like a clock hand, used for colour wheels and pie-chart effects. The angle sets where it starts.
Why gradients go grey in the middle, and how OKLCH fixes it
By default, browsers blend gradients in sRGB, mixing the red, green and blue numbers directly. Between two strong complementary colours, such as blue and yellow, that passes through a muddy grey. Choosing Smooth (OKLCH) adds in oklch to the CSS, which blends lightness, colourfulness and hue separately, so the middle stays vivid. All current browsers support it; Huewell also writes a plain sRGB line first, so older browsers still show a gradient.
Using the CSS
Paste the line into any CSS rule, for example on a body, a header or a button. Gradients are images in CSS, so they go in background or background-image, not background-color. To put a gradient on text, add background-clip: text and color: transparent.
Questions
How do I make a gradient in CSS?
Use background: linear-gradient(90deg, #ff7e5f 0%, #feb47b 100%). The first value is the direction, then each colour with its position. This tool writes it for you.
What does "in oklch" do in a gradient?
It tells the browser to blend the colours in the OKLCH colour space instead of sRGB, which avoids grey, washed-out middles between contrasting colours.
How many colours can a gradient have?
CSS allows any number of stops. This tool allows up to six, which covers nearly every design.
Can I make a hard line instead of a blend?
Yes: give two stops the same position, for example red 50% and blue 50%, for a sharp split.
Can I share a gradient?
Yes. The page address holds the full gradient, so copy it from the address bar.