Skip to content
Design & colour

CSS Gradient Generator

Drag stops, set the angle, and take the CSS or the Tailwind arbitrary value. Every change is previewed at full size rather than in a swatch.

Colour stops

CSS

Tailwind

Presets

About the CSS Gradient Generator

Gradient syntax is simple enough to write by hand and tedious enough that nobody wants to. The difficulty is not the syntax, it is that a gradient cannot be judged from numbers — you have to see it, at size, and adjust.

There are three kinds and they do different things. Linear runs along an angle and is what most interfaces use. Radial spreads from a point and is useful for spotlights and soft backdrops. Conic sweeps around a centre like a clock face, which makes it the one to reach for when building a colour wheel or a pie chart in pure CSS.

Stops are sorted before the CSS is written, and that is not cosmetic. If a stop appears before the one preceding it, CSS clamps it rather than reordering — which produces a hard edge exactly where you wanted a blend, with no error to explain it. Sorting first makes that impossible.

One thing worth knowing about gradients in general: a two-stop gradient between complementary colours passes through grey in the middle, because interpolation in sRGB runs through the desaturated centre of the space. If a gradient looks muddy halfway along, that is why — and adding a third, more saturated stop in the middle is the usual fix.

Everything runs in your browser.

Frequently asked questions

Why does the middle of my gradient look grey?

Because interpolating between two opposing hues in sRGB passes through the desaturated centre of the colour space. Adding a saturated stop in the middle is the usual fix.

When would I use a conic gradient?

When the colour should sweep around a centre rather than across a line — colour wheels, pie charts and progress rings, all in pure CSS.

Why are the stops sorted automatically?

Because CSS clamps a stop that comes before the previous one instead of reordering it, which silently produces a hard edge where you wanted a blend. Sorting first prevents it.