Skip to content
Colour Lab

Gradient Generator

CSS gradient generator for linear, four-corner and mesh gradients with optional grain. Copy the CSS or export a PNG background.

  • #gradient generator
  • #css gradient
  • #background gradient generator
  • #gradient
  • #css
  • #linear
  • #mesh
  • #colour
  • #background
100% client-side

Runs in your browser. Your data never leaves this device.

The Workbench
Gradient Generator — workspaceLive
%
%
deg
0%

Adds grain texture to reduce banding. Only applies to image export, not CSS.

×px
linear-gradient(90deg, #3b82f6 0%, #8b5cf6 100%)
Network requests0
Bytes uploaded0
Trackers fired0
The Guide

About Gradient Generator

/01 Building gradients and copying the CSS

Build linear, radial, corner and mesh gradients visually — add colour stops, drag them along the ramp, set the angle — then copy the CSS straight out. Far quicker than editing numbers in a stylesheet and reloading to see what changed.

What you see in the preview is what the copied CSS produces.

/02 Avoiding the grey band in the middle

Interpolating between two saturated colours in sRGB often passes through a desaturated, muddy middle — blue to yellow is the classic offender. It happens because the numeric midpoint between two RGB values is not the perceptual midpoint.

Adding an intermediate stop in a colour you actually want fixes it, and modern CSS can interpolate in perceptual spaces like OKLCH, which keeps the blend vivid across its whole length. For backgrounds behind text, remember that contrast changes along the gradient — check the worst point, not the average.

/03 Three kinds of gradient, all as CSS

This gradient generator builds three kinds. Linear gradients are the familiar one: set an angle, add colour stops, and copy a linear-gradient() line straight into your stylesheet. The corner mode blends a different colour from each of the four corners, producing soft, glowing backgrounds that a single linear gradient cannot. The mesh mode goes further with a grid of control points you drag around the preview, for the organic, blurry colour fields popular in modern landing pages.

Corner and mesh gradients are built from layered radial-gradient() values, so they also copy out as plain CSS with no images to host. When you need a file instead, for a phone wallpaper, a presentation or a social post background, export a PNG at HD 1920 × 1080, square 1080 × 1080 or story 1080 × 1920. The optional noise setting adds fine grain, which gives flat digital gradients a more tactile, printed feel.

/04 Gradient text and full-page backgrounds

Gradient text needs three declarations: set the gradient as the element's background, then add background-clip: text (with -webkit-background-clip: text for wider support) and color: transparent. The letters become windows onto the gradient. Keep it for large headings, since thin body text in a gradient is hard to read.

For a full-page background, apply the gradient to the body or a wrapper and give it min-height: 100vh. Without that, a short page lets the gradient end part-way down the screen and repeat in bands.

FAQ

Questions about Gradient Generator.

Why does my gradient look grey in the middle?
Because sRGB interpolation passes through a desaturated midpoint between distant hues. Add an intermediate colour stop, or interpolate in a perceptual space such as OKLCH.
What is a mesh gradient?
A gradient with multiple colour points spread across a surface rather than along a single line, producing soft irregular blends instead of a straight ramp.
Can I put text over a gradient?
Yes, but check contrast at the lightest and darkest points of the gradient, not just the average. A gradient that passes on one end can easily fail on the other.
How do I make gradient text in CSS?
Give the text element your gradient as a background-image, then add background-clip: text, -webkit-background-clip: text and color: transparent. Use it on large headings, where the effect reads clearly.
Why does my gradient show visible stripes?
That is colour banding. Screens show a limited number of shades, so slow transitions over large areas step visibly. Add grain with the noise option, which breaks up the steps, or add an intermediate colour stop to shorten the transition.
How do I stop a background gradient repeating?
Give the element holding it enough height, such as min-height: 100vh on the body or a page wrapper. A gradient on a short element ends where the element ends, and the browser repeats it to fill the rest.
Related
Colour Converter

Convert hex to RGB, and between HSL, OKLCH, LAB, LCH and OKLAB, with a colour picker and every format shown at once.

hex to rgbrgb to hexcolor code converter
Contrast Checker

WCAG contrast checker: test any text and background colour pair against WCAG 2.1 AA and AAA ratios, with a live preview.

contrast checkerwcag contrastcolor contrast checker
Harmony Generator

Color harmony generator: build complementary, triadic, analogous, split-complementary, tetradic and monochromatic schemes from one colour.

color harmonycomplementary colorscolor wheel generator
Tailwind Shade Generator

Tailwind color palette generator: turn one colour into a full 50 to 950 shade scale, as a Tailwind config or CSS variables in hex or OKLCH.

tailwind color palettetailwind color generatortailwind shades
Pixel Picker

Color picker from image: upload a photo or screenshot and sample the exact hex colour of any pixel with a magnified zoom loupe.

color picker from imagehex color from imageimage color picker
Palette Extractor

Color palette from image: extract dominant, vibrant, muted, warm or cool colours from any photo, with hex codes to copy.

color palette from imageextract colors from imageimage to color palette
Palette Generator

Color combination generator: create colour palettes from a seed colour with multiple strategies, lock colours you like, and export them.

color combination generatorcolor palette generatorcolor scheme generator
Palette Collection

Browse 284 curated color palettes across artistic, nature, vintage, modern, soft, bold, seasonal and monochrome styles, and copy any colour.

color palettescolor palette ideashex color palettes
Colour Blindness Simulator

Color blindness simulator: preview an image or colour as people with protanopia, deuteranopia, tritanopia and five other colour vision types see it.

color blindness simulatorcolor blind simulatorred green color blindness