🌐 English

Home › Guides

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.

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.

Banding and text readability

A gradient with a small color difference stretched across a large area can show visible bands instead of a smooth fade, especially in dark colors. You can widen the difference between the ends a little, or add a very faint noise texture to blur the steps.

When text sits on a gradient, check contrast at both its lightest and its darkest parts.

A working routine

In the gradient generator, first set two colors and an angle and look at the preview for a muddy center. If it is muddy, insert a midpoint stop or move one color to a neighbor hue. When you like it, copy the generated code and use it as is.

Finally, check at other screen sizes and brightness levels. A gradient that looked smooth on a small screen can show bands on a large one. One or two small adjustments make a large difference in polish.

Common mistakes

Awkward gradients usually come down to a few causes. Going through the items below after you finish fixes most of them.