CSS gradient generator
Build a linear, radial or conic gradient, then copy the CSS for your site or save it as a PNG background.
OKLab avoids the grey middle that sRGB gives between opposite colours. The CSS keeps an sRGB line first for older browsers.
Colour stops
PNG image
How to use it
- Choose Linear, Radial or Conic, and set the angle or the shape.
- Edit the colour stops: type any colour code, open the picker, or move the position. Add a stop fills the widest gap, up to eight stops.
- Press Copy CSS, or set a width and height and Download PNG for a wallpaper, slide or social background.
Linear, radial and conic
A linear gradient runs along a line at an angle: 0° goes from bottom to top, 90° from left to right. A radial gradient spreads out from the centre as a circle, or as an ellipse that follows the shape of the box. A conic gradient sweeps around the centre like a clock hand, starting at the angle you set; it draws pie charts and colour wheels.
Why blend in OKLab
Browsers blend gradient colours in sRGB by default, which can turn the middle of blue to yellow into a flat grey. OKLab blends by how colours look, so the middle stays bright.
The CSS keeps a plain sRGB line first. A browser that does not understand the OKLab line ignores it and uses the first one. The PNG download uses the blend you chose.
Fading to transparent
Type a stop with transparency, such as #E8A04A00 or rgb(232 160 74 / 0%), to fade into whatever is behind the element. The PNG keeps the transparency.
Related tools
Questions people ask
How do I use the CSS?
Paste the lines into the CSS rule of the element, for example a section or the body. The gradient becomes its background.
Can I make gradient text?
Yes. Put the background line on the text element, then add -webkit-background-clip: text; background-clip: text; color: transparent;.
What size should the PNG be?
1920 × 1080 suits desktop wallpapers and slides. 1080 × 1080 or 1080 × 1350 suit Instagram posts. Up to 8000 pixels on each side works.
How many colours can a gradient have?
CSS has no fixed limit. This page lets you set up to eight stops, which covers almost every design.
Is anything uploaded?
No. The gradient and the PNG are made in your browser.