How to use the Mesh Gradient Generator
- 1
Choose how many points
Set between three and eight colour points. New points get random positions and soft colours.
- 2
Arrange and recolour
Drag the round handles on the preview and pick a colour for each point below it.
- 3
Set spread and base
Spread decides how far each colour reaches; the base colour fills any area the points don’t cover.
- 4
Copy CSS or download PNG
Copy the background lines, or press the PNG button for a full-HD image file.
Features
Draggable points
Every colour point is a handle you can move anywhere in the frame.
Harmonious randomise
Random colours step around the colour wheel from one starting hue, and the base gets a pale opposite hue.
PNG wallpaper
A 1920 × 1080 export drawn on a canvas in your browser.
Readable code
One radial-gradient per line, listed point by point.
Remembers your mesh
Point positions and colours are saved in this browser.
Single spread control
One slider changes every layer’s fade distance together.
Who uses it — and for what
Startup and app sites
Soft hero backgrounds behind headlines and screenshots.
Phone and desktop wallpapers
Download the PNG and set it as a background.
Slides and thumbnails
Gentle colour washes behind titles.
Glass UI demos
A colourful backdrop that makes frosted panels visible.
Mesh gradients in pure CSS
Design tools like Figma have true mesh gradients; CSS doesn’t — but you can get the same soft, painterly look by stacking several radial-gradient() layers, each fading from a colour to transparent, over a base colour. Every draggable point here is one layer at that position. Spread controls how far each colour reaches before it fades, so low values give distinct blobs and high values blend everything into a smooth wash.
Where to use them
Mesh gradients make great hero backgrounds, app splash screens, card headers and social images. Because they are CSS, they are only a few hundred bytes, never pixelate and adapt to any screen size. Need an image file instead — for a slide deck or phone wallpaper? Use the PNG button for a 1920 × 1080 export. Add a grain texture or a backdrop-filter glass card on top for the popular “frosted aurora” look.
Everything updates live as you drag — copy the code when it looks right. Nothing is uploaded and there is no sign-up.
How the spread percentage is measured
Each layer is written as radial-gradient(at X% Y%, colour 0px, transparent N%). No shape or size is given, so the browser uses its defaults: an ellipse sized to reach the farthest corner of the box. The spread percentage is a share of that distance. Two consequences are worth knowing:
- A point near a corner has a long way to the opposite corner, so at the same spread it reaches further across the box than a point in the centre.
- On a wide hero the ellipses are wide too. The same CSS on a tall phone screen produces taller, narrower glows, which is part of why mesh backgrounds feel different on mobile — check both.
Layers are painted with the first one on top. Point 1 therefore sits above point 2 where they overlap; to bring a colour forward, move its line higher in the copied list. Modern browsers fade to transparent without the grey fringe older engines produced, because they blend colours with their transparency taken into account.
CSS or PNG — which to use?
| CSS background | PNG download | |
|---|---|---|
| File size | A few hundred bytes of text | A full-HD image file, usually far larger |
| Sharpness | Redrawn at any size | Fixed 1920 × 1080; scaled on other screens |
| Fits the element | Adapts to every aspect ratio | Cropped or stretched to fit |
| Works outside the web | No | Yes — slides, wallpapers, social posts |
| Exact match | — | Drawn separately with canvas gradients, so tiny differences from the CSS preview are possible |
Whichever you use, check text placed on top. A mesh changes colour across its area, so contrast that passes over the pale base may fail over a saturated blob; test the darkest and lightest spots behind your text with the Contrast Checker. Large, very soft gradients can also show faint banding on some screens — a subtle noise overlay hides it. For straight two- or three-colour blends, the CSS Gradient Generator is simpler.
Worked examples
The default five-point mesh
The starting mesh writes:
background-color: #ffeedd;
background-image:
radial-gradient(at 15% 20%, #ff9a9e 0px, transparent 55%),
radial-gradient(at 82% 14%, #a18cd1 0px, transparent 55%),
radial-gradient(at 62% 82%, #fbc2eb 0px, transparent 55%),
radial-gradient(at 18% 86%, #84fab0 0px, transparent 55%),
radial-gradient(at 46% 46%, #8fd3f4 0px, transparent 55%);Fewer points, tighter spread
Reduce to three points and spread to 30%: the code keeps only the first three layers, each ending at transparent 30%. The pink, violet and lilac become separate glows, and much more of the peach base shows between them.
Pro tips
- Keep a light base colour and mid-tone points for a calm, airy look; dark bases with bright points feel more dramatic.
- If two points of similar colour overlap, delete one by lowering the point count — the last points are removed first.
- Moving a handle slightly off the edge (0% or 100%) gives a glow that seems to come from outside the frame.
Glossary
- Mesh gradient
- A smooth blend between many colour points rather than along a single line.
- Farthest-corner
- The default radial-gradient size: the shape extends to the corner furthest from its centre.
- Base colour
- The solid background-color that shows wherever the gradient layers have faded out.
Frequently asked questions
Is this a real mesh gradient?
It is an approximation made of layered radial gradients — it looks very similar and works in every browser.
Will it slow my page down?
No, a handful of gradient layers is drawn quickly by the browser.
Can I animate it?
You can animate background-position or use @property to animate colours in modern browsers.
Why does my mesh look different on a phone?
Each layer is an ellipse sized to the box, so a tall screen stretches the glows vertically. Adjust point positions or use a media query with a second set of positions.
Why is the PNG slightly different from the preview?
The download is redrawn on a canvas at 1920 × 1080 to imitate the CSS layers, so very small differences in how colours fade are possible.
Last updated 2026-11-28 · Built by Vinayak Agarwal · Part of CSS & Design (37 tools)