Skip to the color picker

Gold to teal gradient

A smooth gold 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, #ffd700, #e5cd3b, #cbc351, #b1b85f, #96ad6a, #7ba272, #5f9778, #3e8c7d, #008080);
background: linear-gradient(90deg in oklab, #ffd700, #008080);

Tailwind CSS v4

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

Colors along the gradient

7

How gold 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 #96ad6a in OKLab and #80ac40 in sRGB, so any of them works.

Blend inGradient previewMiddle colorLightnessChroma
OKLab#96ad6a71.5%0.095
OKLCH#67b96b71.5%0.137
sRGB#80ac4068.9%0.145
LCH#4eba5f70.5%0.163
HSL#0fc00069.9%0.237

Questions about this gradient

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

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

Blended in OKLab, the color halfway between gold and teal is #96ad6a. A plain sRGB blend gives #80ac40.

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

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