CSS gradient generator
Pick 2 to 5 colors, choose linear, radial or conic, and set the angle.
Blend in OKLCH for a bright middle, then tap to copy the CSS. Free, no sign-up.
- coral
- violet
sRGB averages the red, green and blue numbers, so opposite colors (blue to yellow) pass through a dull gray middle. Try OKLCH.
Turn it into a 5-color palette · Convert #ff7a59 to RGB, HSL
Now try it by eye
How to make a gradient
- Choose your colors. Tap a swatch to pick, or type a hex code. Add up to 5 colors and drag each slider to move it along.
- Pick a type and angle. Linear for a straight fade, radial for a glow from the center, conic for a sweep around it.
- Choose how it blends. sRGB is the classic look. OKLCH keeps the colors between your stops bright and even.
- Copy and share. Tap the CSS or Tailwind line to copy it, or copy a link that opens this exact gradient.
Short on ideas? Tap Random for colors spaced evenly around the color wheel, so they always go together.
More
- Color palette generator: tap for 5 colors that go together.
- Color converter: hex, RGB, HSL and CMYK at once.
- Color wheel: drag a color, see what goes with it.
- Color contrast checker: can people read text on your gradient?
- Color sorting game: put a scrambled gradient back in order.
More color tests
- Tints, shades and tonesTell them apart in 30 seconds.
- Color sorting gamePut the gradient back in order.
- Find the different colorSpot the odd tile as it gets harder.
- Color mixing chartWhat two colors make any color.
- RGB color mixerWhy red and green light make yellow.
- Color contrast checkerCan people read this text?
Questions
How do I make a CSS gradient?
Use a gradient as a background image: background: linear-gradient(135deg, #ff7a59 0%, #7c3aed 100%). The angle sets the direction, and each color stop is a color plus where it sits, from 0% to 100%. Build one above and tap the CSS line to copy it.
What is the difference between linear, radial and conic gradients?
A linear gradient changes color along a straight line at the angle you choose. A radial gradient spreads out from the center in circles. A conic gradient sweeps around the center like the hands of a clock, which is handy for color wheels and pie charts.
Why is my gradient muddy or gray in the middle?
By default, browsers blend in sRGB, which averages the red, green and blue numbers. Between opposite colors, such as blue and yellow, that average lands near gray. Blending in OKLCH (linear-gradient(in oklch, ...)) moves through lightness and hue instead, so the middle stays bright. Switch Blend in to OKLCH above to compare.
How do I add a gradient in Tailwind?
Use the built-in classes such as bg-linear-to-r from-orange-400 to-violet-600 (bg-gradient-to-r in Tailwind 3), or paste any CSS gradient as an arbitrary value: bg-[linear-gradient(135deg,#ff7a59_0%,#7c3aed_100%)], with underscores for spaces. This page gives you that class ready to copy.