Skip to content

Colors

CSS Gradient Generator

Design linear and radial CSS gradients with multiple stops and full angle control — previewed live, exported as clean CSS.

0%
100%
CSS
background-image: linear-gradient(135deg, #0ea5e9 0%, #4f46e5 100%);

The preview renders the exact CSS shown — what you see is what you paste. Works in every modern browser.

Getting Smooth Instead of Muddy

Two-stop gradients between complementary colors pass through a gray middle that looks dirty; adding a third stop near the midpoint in a lighter hue keeps the blend alive. Gradients between colors of similar lightness look smoothest — a dark-to-light blend of the same hue almost never bands.

A Note on Color Spaces

This generator interpolates in sRGB, the space CSS uses by default. It is predictable and universal; wide-gamut spaces (display-p3, oklch) produce perceptually smoother blends in modern browsers but are a deliberate choice, not a default. Test contrast for any text that sits on the gradient, at both ends.

How the Color Math Works

  1. Choose linear or radial mode and set the angle or shape.
  2. Add, remove, and reorder color stops; drag stop positions or type exact percentages.
  3. The preview updates live and mirrors the final CSS exactly.
  4. Copy the one-line background-image declaration for your stylesheet.
Formula & Technical Standard
Output: linear-gradient(angle, stop1 pos, stop2 pos, …) or radial-gradient(shape at position, stops).

Worked Example

Hero background
Input: Linear 135°, sky-500 → indigo-600
Output: background-image: linear-gradient(135deg, #0ea5e9, #4f46e5)
Diagonal two-stop gradients are the most common hero-section treatment; the CSS is copy-paste ready.
Radial spotlight
Input: Radial circle at center, white → transparent
Output: Subtle vignette effect
Radial gradients with alpha endpoints create light pools and vignettes without images.

Common Questions

Are the gradients supported in all browsers?

Yes. Unprefixed linear-gradient and radial-gradient work in every browser from roughly 2013 onward.

Can I add more than two colors?

Yes — add as many stops as needed and position each one precisely; hard-stop effects (0% gaps) are supported too.