Skip to the color picker

Violet to teal gradient

A smooth violet 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, #ee82ee, #d885e0, #c286d2, #ac87c4, #9587b6, #7d86a8, #62859b, #42838d, #008080);
background: linear-gradient(90deg in oklab, #ee82ee, #008080);

Tailwind CSS v4

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

Colors along the gradient

7

How violet 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 #9587b6 in OKLab and #7781b7 in sRGB, so any of them works.

Blend inGradient previewMiddle colorLightnessChroma
OKLab#9587b665.3%0.071
OKLCH#5e8ee465.3%0.139
sRGB#7781b761.7%0.083
LCH#3a94e164.9%0.143
HSL#0f0fe943%0.287

Questions about this gradient

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

Use background: linear-gradient(90deg in oklab, #ee82ee, #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 violet and teal?

Blended in OKLab, the color halfway between violet and teal is #9587b6. A plain sRGB blend gives #7781b7.

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

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