Making gradients that look good
A gradient can make a background or button feel polished, but poor color choices leave a muddy middle or visible bands. This guide explains why gradients fail and how to avoid it, step by step.
How a gradient is built
A gradient fills the space between a start color and an end color smoothly. The most common kind is linear, flowing in one direction set by an angle: 90 degrees runs left to right and 180 degrees runs top to bottom. There are also radial gradients that spread from a center point and conic gradients that sweep around it. A gradient that fades to transparent at one end can dissolve naturally over a photo, which is useful for creating a text area. Colors with transparency are written as described in the HEX shorthand guide.
The points that fix where each color sits are called color stops. Two stops make a simple transition, while three or more make a richer flow. If you place two stops at the same position the result is not smooth but a crisp stripe.
Why the middle turns muddy
Joining two nearly opposite colors, such as blue and yellow, often produces a dull grayish center. The two colors cancel each other out in saturation as the blend passes through the middle.
- Pick nearby hues — colors within about 60 degrees on the wheel stay clean through the middle.
- Add a midpoint stop — put a soft teal or green between blue and yellow to detour around the gray.
- Match saturation and lightness — the more alike the two ends are in these, the more natural the transition.
- Choose the blending space — where a tool supports it, blending in a perceptual space such as OKLCH greatly reduces muddiness.
Color combination ideas
A safe starting point is varying the lightness of a single color. A gradient from #7c3aed to a lighter #a78bfa never looks wrong. One step further is shifting the hue by only 20 to 40 degrees: purple to blue, or orange to pink, neighboring colors joined together. After finishing, always view it with real content placed on top. A gradient that looks lovely empty can feel cramped once text and images are on it.
To use colors far apart you need stops that step the blend along gradually. And use gradients in one or two places per screen rather than everywhere; the effect only works when it is rare.