Lab 08
Mesh gradient generator with CSS, SVG and PNG exportSoft color fields,ready to ship.
Place three to six color points on the canvas and drag them where you want them. Set each color and how far it spreads, add a little grain, then copy the CSS or download an SVG or a PNG at the size you need. It all runs in your browser.
Drag a point to move it. Double click an empty spot to add one.
Start from
Points (4 of 6)
background-color: #1b1530;
background-image:
url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='200' height='200'%3E%3Cfilter id='n'%3E%3CfeTurbulence type='fractalNoise' baseFrequency='0.85' numOctaves='3' stitchTiles='stitch'/%3E%3CfeColorMatrix values='0.33 0.33 0.33 0 0 0.33 0.33 0.33 0 0 0.33 0.33 0.33 0 0 0 0 0 0 1'/%3E%3C/filter%3E%3Crect width='100%25' height='100%25' filter='url(%23n)' opacity='0.2'/%3E%3C/svg%3E"),
radial-gradient(67.5% 67.5% at 20% 85%, #2a2366 0%, rgb(42 35 102 / 0.84) 20%, rgb(42 35 102 / 0.49) 40%, rgb(42 35 102 / 0.2) 60%, rgb(42 35 102 / 0.06) 80%, rgb(42 35 102 / 0) 100%),
radial-gradient(75% 75% at 60% 85%, #ff3d8b 0%, rgb(255 61 139 / 0.84) 20%, rgb(255 61 139 / 0.49) 40%, rgb(255 61 139 / 0.2) 60%, rgb(255 61 139 / 0.06) 80%, rgb(255 61 139 / 0) 100%),
radial-gradient(82.5% 82.5% at 15% 20%, #ff7a59 0%, rgb(255 122 89 / 0.84) 20%, rgb(255 122 89 / 0.49) 40%, rgb(255 122 89 / 0.2) 60%, rgb(255 122 89 / 0.06) 80%, rgb(255 122 89 / 0) 100%),
radial-gradient(90% 90% at 80% 15%, #7b5cff 0%, rgb(123 92 255 / 0.84) 20%, rgb(123 92 255 / 0.49) 40%, rgb(123 92 255 / 0.2) 60%, rgb(123 92 255 / 0.06) 80%, rgb(123 92 255 / 0) 100%);
background-size: 200px 200px, 100% 100%, 100% 100%, 100% 100%, 100% 100%;
background-blend-mode: overlay, normal, normal, normal, normal;One radial-gradient per point over the base color, the tightest on top. CSS cannot mix colors the way the mesh does, so this is a close version, not an exact copy. Press CSS version above the preview to compare.
Export size
A mesh gradient generator with CSS, SVG and PNG export
This mesh gradient generator blends three to six color points into one soft field of color. Drag the points, pick their colors, set how far each one reaches and add grain. Then take it out as layered CSS gradients, an SVG file or a PNG at the exact size you need.
- 01
Place the points
Start from a preset such as Dusk or Lagoon, or press Random. Drag a point to move it, or select it and use the arrow keys. Double click an empty spot to add a point, up to six.
- 02
Tune the colors
Pick a point and set its color and spread: a larger spread lets the color reach further across the canvas. The base color shows where no point reaches. Turn on Grain for a soft print texture.
- 03
Export it
Copy the CSS for a background you can paste into any rule, or the SVG. Choose an export size such as Desktop or Story, or type your own, then press Download PNG or Download SVG.
How the mesh is blended
Each point gives every pixel a weight that falls off smoothly with distance, like a soft spotlight. The spread sets how wide that spotlight is. The color of a pixel is the weighted average of all the point colors, so where two points meet, their colors mix.
The mixing happens in OKLab, a color space built so that equal steps look equal to the eye. Mixing in plain RGB tends to make a grey or muddy band between two bright colors, such as blue and yellow. In OKLab the middle of the blend stays clean. The PNG download uses this blend exactly.
Why the CSS is an approximation
CSS has no mesh gradient. The closest thing is a stack of radial-gradient() layers over a background color, one per point, each fading from its color to transparent. The tool writes the stack for you, with the tightest point on top, and uses the same layers for the SVG.
Stacked layers lay color on top of color instead of averaging it, so the CSS looks a little different from the mesh where points overlap. Press CSS version above the preview to see the CSS on its own. If you need the exact blend, use the PNG; if you need a light, sharp background at any size, use the CSS or the SVG.
Using a mesh gradient on a real site
For a hero or a section background, the CSS weighs almost nothing and stays sharp on every screen. Put text on a calm part of the mesh and check the contrast there, because the color changes under the text. The palette tool checks contrast pairs if you build the colors from a brand palette.
The grain is there for a reason: smooth gradients can show visible bands on some screens, and a little noise hides them. In CSS the grain is a small SVG noise tile blended with overlay. To animate a mesh, move the points slowly, and keep it still for people who turn motion off, as this tool does with the Drift preview option.
Frequently asked questions
What is a mesh gradient?
A mesh gradient blends several colors placed at different points on a surface, instead of along one line or out from one center. The result is a soft, organic field of color. Design tools draw them with a grid of points; on the web you can get close with layered CSS radial gradients, or use an image.
Can I make a mesh gradient in pure CSS?
Yes, as an approximation. Stack one radial-gradient() per color, each fading to transparent, over a background-color. This tool writes that CSS for you, with the stops spaced so each color fades out softly. It needs no images, so it loads instantly and scales to any size.
What size should I export the PNG at?
Export at the largest size the image will be shown, in device pixels. For a full width desktop hero, Desktop (1920 by 1080) or 4K (3840 by 2160) works. For social posts, use Square, Portrait or Story. The CSS and SVG have no fixed size, so they suit backgrounds that resize.
Is the mesh gradient generator free to use?
Yes. The gradients you make are yours for any project, personal or commercial, with no account and no credit needed. Everything runs in your browser: the colors, the CSS and the images are made on your device and nothing is uploaded or stored.
Need this built into your site?
I build tools like this one, and the sites around them. Tell me what you need and I will reply with a plan and a fixed price.