Skip to the color picker

Red to teal gradient

A smooth red to teal gradient in CSS, blended in OKLab so the middle stays clean. Change the angle, add colors and copy the code.

Colors

Blend in

OKLab keeps the middle bright. sRGB is how old browsers blend and often turns gray in the middle.

Type
90°

CSS

background: linear-gradient(90deg, #ff0000, #ea3b29, #d5503c, #bf5f4b, #a86a57, #8f7263, #72786d, #4f7d77, #008080);
background: linear-gradient(90deg in oklab, #ff0000, #008080);

Tailwind CSS v4

bg-linear-90/oklab from-[#ff0000] to-[#008080]

Colors along the gradient

7

How red and teal blend in each color space

The same two colors give a different middle depending on the space the browser blends in. These are the exact colors at 50%. These two colors blend almost the same way in every space: the middle is #a86a57 in OKLab and #804040 in sRGB, so any of them works.

Blend inGradient previewMiddle colorLightnessChroma
OKLab#a86a5758.6%0.085
OKLCH#7f830058.6%0.175
sRGB#80404045.2%0.088
LCH#52880056.5%0.167
HSL#60c00071.9%0.213

Questions about this gradient

How do I make a red to teal gradient in CSS?

Use background: linear-gradient(90deg in oklab, #ff0000, #008080). Add a line before it with the sRGB version for very old browsers. Interpolation in OKLab works in all current browsers.

What color is halfway between red and teal?

Blended in OKLab, the color halfway between red and teal is #a86a57. A plain sRGB blend gives #804040.

How do I make a red to teal gradient in Tailwind CSS?

In Tailwind CSS v4 use the classes bg-linear-90/oklab from-[#ff0000] to-[#008080].