Red to cyan gradient
A smooth red to cyan gradient in CSS, blended in OKLab so the middle stays clean. Change the angle, add colors and copy the code.
Colors
OKLab keeps the middle bright. sRGB is how old browsers blend and often turns gray in the middle.
CSS
background: linear-gradient(90deg, #ff0000, #f8513b, #ee745b, #e29078, #d2a993, #bec0ae, #a3d6c9, #79ebe4, #00ffff);
background: linear-gradient(90deg in oklab, #ff0000, #00ffff);Tailwind CSS v4
bg-linear-90/oklab from-[#ff0000] to-[#00ffff]Colors along the gradient
How red and cyan 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%. Blended in plain sRGB, the middle is #808080 with a chroma of 0. OKLab gives #d2a993 with 0.057, so the sRGB version looks noticeably grayer in the middle.
| Blend in | Gradient preview | Middle color | Lightness | Chroma |
|---|---|---|---|---|
| OKLab | #d2a993 | 76.7% | 0.057 | |
| OKLCH | #b8bd00 | 76.7% | 0.206 | |
| sRGB | #808080 | 59.8% | 0 | |
| LCH | #84c307 | 74.6% | 0.197 | |
| HSL | #80ff00 | 89% | 0.265 |
Questions about this gradient
How do I make a red to cyan gradient in CSS?
Use background: linear-gradient(90deg in oklab, #ff0000, #00ffff). 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 cyan?
Blended in OKLab, the color halfway between red and cyan is #d2a993. A plain sRGB blend gives #808080.
How do I make a red to cyan gradient in Tailwind CSS?
In Tailwind CSS v4 use the classes bg-linear-90/oklab from-[#ff0000] to-[#00ffff].