Home / Colour / Gradient Generator

Gradient Generator

Blend two or three colours into a smooth gradient, watch it happen in a live preview, and copy clean CSS when it looks right. Every slider redraws the preview instantly — no save-and-refresh cycle. All blending happens in your browser.

0%

Overview

Gradients are where flat design gets its depth back: a hero banner warming from amber to ember, a button that feels lit rather than printed, a background suggesting dusk without a photograph. Writing the CSS by hand, though, means guessing at angles and stop positions, saving, refreshing, squinting — and repeating until it looks right. This generator removes the refresh cycle entirely: every slider you touch redraws the preview instantly, and the code underneath is always the exact code for what you're seeing.

You control up to three colour stops, each with its own position along the blend, plus the angle of a linear gradient or the centred glow of a radial one. When the preview matches the picture in your head, one click copies production-ready CSS — a flat fallback colour first, then the gradient declaration, so even ancient browsers land on something sensible instead of nothing.

What is a CSS gradient?

A CSS gradient is an image the browser paints from instructions rather than loading from a file. You name the colours to travel between — the stops — and where along the journey each colour should be fully itself. Between stops, the browser interpolates in fine steps, mixing the colours so the eye reads one continuous blend. A linear gradient travels in a straight line at your chosen angle; a radial gradient blooms outward from a centre point, like light from a lamp.

Because gradients are instructions, not pixels, they stay perfectly sharp at every screen size and weigh almost nothing next to a background photograph — and recolouring means editing two values, not re-exporting an asset. Their one honest limit is that the blend follows a straightforward path between colours, so a long journey between distant hues can pass through a muddy middle. That's exactly what the third stop is for: placed in the muddy zone, it steers the blend somewhere prettier.

Features

Benefits

Who can use it

Front-end developers styling hero sections, buttons and cards without opening an image editor. Designers handing off exact CSS instead of vague descriptions. Bloggers giving a plain theme some depth with a custom background. Students learning CSS who want to see how gradients respond to each value. Anyone maintaining a site who needs 'a nice background, quickly' — pick a preset, nudge the angle, copy the code, paste it into the stylesheet. Five minutes, no assets, no build step.

How to use

  1. Pick your colours using the stop controls — two for a classic blend, three for extra control.
  2. Drag the position sliders to decide where each colour is fully itself along the blend.
  3. Choose linear and set the angle, or switch to radial for a centred glow.
  4. Try a preset (Sunset, Ocean, Forest, Berry) if you want a starting point.
  5. When the preview looks right, copy the CSS and paste it into your stylesheet.

Frequently asked questions

Linear or radial — which should I choose?

Linear for direction: banners, section dividers, buttons — anywhere you want the eye to travel along a path. The angle sets that path; diagonals feel dynamic, verticals feel calm. Radial for focus: glows behind a headline, vignettes, spotlight effects — anywhere you want attention drawn to a centre. Neither is 'better'; they're different tools. If you're unsure, start linear at 135° — it's the most versatile gradient in existence.

Why would I add a third stop?

To rescue blends that pass through ugly territory. When two distant colours mix directly — say, a warm orange into a cool blue — the midpoint can turn muddy grey, because the straight path between them crosses a dull zone. A third stop placed in that zone lets you steer: drop in a richer intermediate colour and the gradient travels through somewhere prettier. It's the difference between a gradient that looks accidental and one that looks designed.

What does the angle actually change?

The direction the colours travel. 0° (or 360°) runs bottom to top, 90° runs left to right, 180° top to bottom, 270° right to left — and anything between is a diagonal. The angle dramatically changes the mood: a vertical blend feels stable and calm, a diagonal feels energetic. There's no wrong answer, only the feeling you're after. Drag it and watch the preview; your eye will know within seconds.

Will my gradient work in old browsers?

The copied CSS includes a flat fallback colour declared before the gradient, so ancient browsers simply show a solid colour — never a broken background. Every browser released in roughly the last decade supports linear and radial gradients fully, including all the stop and angle features here. Unless your audience is on truly museum-grade software, what you design is what they'll see.

Why does my gradient look muddy in the middle?

Because the shortest path between your two colours crosses a dull region of colour space — most often when blending across the wheel, like orange to blue or red to green. The fix is a third stop: sample the preview's midpoint, then replace that stop with a richer colour from the same family as your endpoints. Alternatively, nudge one endpoint toward the other on the wheel. Muddy middles are the most common gradient complaint and the easiest to fix.

Can I use this as a full-page background?

Yes — paste the CSS into your body or main container's background property and it will fill whatever it's applied to, staying sharp at any size. For full-page use, subtle is usually better: low-contrast blends or a gentle radial glow read as texture rather than decoration. Pair it with the fallback colour for safety, and check text contrast over the busiest part of the blend — beauty means nothing if nobody can read the words.

Conclusion

Backgrounds shouldn't need an image editor. Pick two or three colours, place the stops, set the angle, and copy CSS that's ready for production — fallback included. What used to be a guess-refresh-guess loop is now a slider, a preview, and a paste.

Related tools

ColourPalette GeneratorFive-colour palettes from one colour and a harmony rule. ColourContrast CheckerExact WCAG contrast ratios and pass/fail verdicts for any text colour. ColourColour StudioOne colour in every format: HEX, RGB, HSL, HSV, tints and shades.