Gradients

Linear, radial, conic and mesh: every type of gradient explained

Every gradient moves colour along a path. Change the path and you change the feeling. Here is each type, what it looks like, the code for it and the job it does best.

GradientlyVerified Gradiently account··5 min read
Cover: Wheat Interval · GR·CRSE·BC

The short version

  • The main types of gradients are linear, radial, conic and mesh, and each moves colour along a different path.
  • Linear gradients change colour along a straight line, radial gradients spread from a point, and conic gradients sweep around a centre.
  • Repeating gradients tile a short blend over and over to make stripes, rings and sunbursts.
  • Mesh and freeform gradients blend several points of colour in two dimensions, which is why they look organic rather than geometric.
  • Grain is not a gradient type but a layer on top, and it changes how every type reads more than most people expect.
On this page

There are four main types of gradients: linear, radial, conic and mesh. Linear gradients change colour along a straight line, radial gradients spread outwards from a point, conic gradients sweep around a centre like a clock hand, and mesh gradients blend several points of colour at once in two dimensions. Around them sit a few useful variations: repeating gradients, freeform gradients and grain, which is a texture laid on top rather than a type of its own.

Below, each type gets a live example you can copy, a note on what it is good at, and a link to its full guide. If you are starting from zero, what a gradient is explains stops, positions and colour spaces first.

Linear gradients

A linear gradient runs along a straight line at an angle you choose. In CSS the default direction is top to bottom, 0deg points up, and angles turn clockwise, so 90deg runs left to right and 135deg runs from the top left corner towards the bottom right. It is the most common type by far, because it is predictable, fills any rectangle cleanly and suggests light falling from one side.

Same type, three directions. Vertical feels calm, horizontal feels like movement, diagonal feels energetic.

Use linear gradients for page and post backgrounds, buttons, banners and anything that needs to tile or scale predictably. The syntax and its details are in CSS linear gradients, and choosing a direction is covered in gradient angle.

Radial gradients

A radial gradient starts at a point and spreads outwards as a circle or an ellipse. Moving that point off centre is the trick that makes it look like light: a glow from the upper left reads as a lamp, a sun or a highlight on a curved surface. Radial gradients are also how most soft vignettes and spotlight effects are built.

Off-centre radial glowradial-gradient(circle at 30% 30%, #fef3c7 0%, #fbbf24 20%, #ea580c 50%, #431407 100%)
The centre sits at 30% across and 30% down, so the brightest point feels like a light source rather than a target.

Use radial gradients for glows, spotlights, vignettes, orbs and anything that should feel lit from a point. See radial gradients for sizing keywords such as closest-side and farthest-corner.

Conic gradients

A conic gradient changes colour as you travel around a centre point, rather than away from it. Picture the sweep of a clock hand. That makes it the natural choice for colour wheels, pie charts, loading rings and angular sheens like brushed metal or the rainbow flash on a holographic foil.

Conic gradients sweep around the centre. Hard stops turn one into a pie chart; soft greys turn one into metal.

Use conic gradients for wheels, charts, sheens and iridescence. The full guide is conic gradients, and the foil look is in holographic gradients.

Repeating gradients

Each of the three CSS types has a repeating version. Instead of stretching one blend across the whole shape, it repeats a short blend over and over. With hard stops that gives you crisp stripes, rings and sunbursts with no image files at all.

Short blends, repeated. Pattern libraries are built almost entirely from these three.

Mesh and freeform gradients

A mesh gradient places colour at several points across a surface and blends them all in two dimensions. Illustrator calls its point-and-grid version a gradient mesh and its looser version a freeform gradient. Either way, the result has no single direction, which is why it looks organic, like light through water or paint that has run. CSS has no mesh type, but you can fake one convincingly by stacking soft radial gradients over a base colour.

css
.mesh {
  background-color: #0b1026;
  background-image:
    radial-gradient(at 18% 22%, #7c3aed 0px, transparent 55%),
    radial-gradient(at 82% 18%, #0ea5e9 0px, transparent 50%),
    radial-gradient(at 70% 85%, #f472b6 0px, transparent 55%),
    radial-gradient(at 25% 80%, #14b8a6 0px, transparent 50%);
}
Four soft radial layers over a dark base make a passable mesh. Move the at positions to move the colour pools.

Organic, directionless colour is what mesh gradients are for: nothing points anywhere, so the eye rests.

Use mesh gradients for hero backgrounds, wallpapers, album art and brand fields that should feel alive. The pitfalls, mainly mud and banding, are in mesh gradients.

Grain and texture: the layer on top

Grain is not a gradient type, but it changes how every type reads. A fine layer of noise hides the stripes that smooth blends can show on screens, and it makes digital colour feel printed or filmic. Other materials, such as paper, glass and silk, do the same job with a different voice. See grainy gradients for how much to add.

Which type of gradient to use

TypeBest forFeels
LinearBackgrounds, buttons, banners, barsDirectional, clean, calm
RadialGlows, spotlights, vignettes, orbsLit, focused, warm
ConicWheels, charts, sheens, foilAngular, metallic, precise
RepeatingStripes, rings, patternsGraphic, retro, rhythmic
Mesh or freeformHeroes, wallpapers, album artOrganic, soft, alive
Any type with grainPosters, social, brand fieldsPrinted, tactile, considered
A starting point, not a rule. Many good designs combine a linear base, a radial glow and a layer of grain.

If you want a finished field with colour, light and grain already balanced, that is what a Mark is, and you can design with any Mark in the Market for free.

Questions people ask

What are the four types of gradients?

Linear, radial, conic and mesh. Linear follows a straight line, radial spreads from a point, conic sweeps around a centre and mesh blends several points in two dimensions.

What is the difference between a linear and a radial gradient?

A linear gradient changes colour along a straight line at an angle. A radial gradient changes colour outwards from a centre point in a circle or ellipse.

What is the difference between a conic and a radial gradient?

A radial gradient changes colour as you move away from the centre. A conic gradient changes colour as you move around the centre, like a clock hand.

Can CSS make a mesh gradient?

CSS has no mesh gradient type, but stacking several soft radial gradients over a base colour gives a convincing mesh look.

Is grain a type of gradient?

No. Grain is a texture layered over any gradient type. It hides banding and makes the colour feel printed rather than digital.

Share this guide

Written by GradientlyVerified Gradiently account

The team behind Gradiently, a design tool built around Marks: living gradients that make everything you design look like yours.

See our profile