Color Converter (HEX, RGB, HSL)→Specialized Version
🎨

CSS Gradient Generator

Generate CSS gradients

RGB
HSL

All formats

Gradient

#F43F5E

Lightness variations

CSS Gradient Generator

Create beautiful CSS gradients visually. Build linear, radial, and conic gradients with custom colors, positions, and angles.

Gradient Types

TypeCSSUse Case
Linearlinear-gradient()Backgrounds, buttons
Radialradial-gradient()Spotlights, orbs
Conicconic-gradient()Pie charts, dials

Linear Gradient Syntax

``css /* Direction + colors */ .gradient { background: linear-gradient(to right, #3B82F6, #8B5CF6); }

/* Angle */ .angled { background: linear-gradient(135deg, #FF6B6B, #4ECDC4); }

/* Multiple stops */ .rainbow { background: linear-gradient( 90deg, red, orange, yellow, green, blue, violet ); } `

Gradient Directions

DirectionCSSAngle
Left to rightto right90deg
Top to bottomto bottom180deg
Diagonalto bottom right135deg

Popular Gradient Combos

NameColors
Sunset#FF512F → #F09819
Ocean#2193B0 → #6DD5ED
Royal#141E30 → #243B55
Candy#D53369 → #CBAD6D

Export Options

  • Copy CSS code
  • Copy as Tailwind class
  • Download as image
  • Save gradient preset
Create stunning gradients for modern web designs.

Gradients That Do Not Go Grey

A two-stop gradient between complementary colours passes through grey in the middle, because linear interpolation in sRGB runs straight through the neutral axis.

Two fixes:

  • Add a mid-stop in a hue between the two endpoints.
  • Interpolate in a better space: linear-gradient(in oklch, blue, yellow) travels
around the hue wheel instead of through the middle.

Also worth knowing:

  • Gradient banding shows on large areas with 8-bit colour. A subtle noise overlay hides
it, as does keeping the two stops closer together.
  • Text on a gradient needs a contrast check against the *worst* point of the gradient,
not the average.
  • transparent is not neutral — it means rgba(0,0,0,0), so fading to it passes
through grey. Fade to rgba(255,255,255,0) on a light background instead.

A Full Ramp From This Colour

Design systems settle on a 50–900 scale because it covers backgrounds, borders, text and states without anyone reaching outside the palette. Mixing toward white and black rather than adjusting HSL lightness keeps more of the hue's character:

StepColourContrast on whiteSafe for
50#F5F9FF1.06:1backgrounds and fills
100#EBF3FE1.12:1backgrounds and fills
200#CEE0FD1.34:1backgrounds and fills
300#B1CDFB1.62:1backgrounds and fills
400#76A8F92.40:1backgrounds and fills
500#3B82F63.68:1large text, borders
600#326FD14.85:1body text on white
700#295BAC6.59:1body text on white
800#2048878.98:1body text on white
900#18346212.31:1body text on white
The contrast column is the one that decides usage. Steps below 3:1 cannot carry text at any size and belong in fills and dividers; steps at 4.5:1 and above are safe for body copy.

Adjusting It

Base colour in HSL is hsl(217, 91%, 60%). Two useful moves:

`css /* +10% lightness, same hue */ --lighter: #6da2f8; /* −10% lightness */ --darker: #0b64f4; ``

Raising lightness also drops perceived saturation, so a lightened colour reads greyer than its numbers suggest. Adding 5–10% saturation alongside every 20% of lightness keeps the ramp looking like one hue rather than a fade to grey.

Frequently Asked Questions

What gradient types are supported?

Linear (straight line), radial (circular), and conic (angular) gradients are all supported in CSS.

How many colors can a gradient have?

CSS gradients can have unlimited color stops, allowing complex multi-color transitions.

Do gradients work in all browsers?

Modern CSS gradients are supported in all current browsers. Legacy browsers may need vendor prefixes.

Related Tools

Explore other tools you might find useful:

More Color Converter (HEX, RGB, HSL) tools

You might also need