Loading Techie Utils…

Color Mixer

Blend two colours in OKLCH, OKLab or sRGB and get the CSS color-mix() for it. Free, and runs entirely in your browser — nothing is uploaded.

About Color Mixer

Blends two colours by any amount and shows the result in six colour spaces side by side, with a ramp of steps between them and the CSS color-mix() that makes the browser do the same mix live.

The space matters more than people expect. Mixing in sRGB averages the stored numbers, and because those numbers are gamma-encoded, the middle of a blend between two saturated colours goes dull and dark — the familiar muddy midpoint. OKLab mixes in a space built around perception, so the midpoint looks halfway; OKLCH also travels round the hue circle — the shorter way, as CSS does — so blue to amber passes through violet and pink instead of grey.

color-mix(in oklch, #3f6dfb 60%, #f59e0b) is supported in every current browser, which makes the mix a live value: change either colour in a custom property and every mix derived from it follows.

Where it helps

  • Shows the same mix in six spaces, so the difference between them is visible, not theoretical.
  • Writes the color-mix() declaration for a live mix in CSS.
  • Builds a ramp of any number of steps between the two colours.
  • Handles grey endpoints properly, so a mix with white or black does not swing through an unrelated hue.

Limits

  • HSL mixing is included for comparison, but it is rarely what you want — its lightness is not perceptual.
  • color-mix() percentages belong to the first colour, which is the reverse of the amount field here; the CSS written out accounts for that.

Frequently asked questions

Why does the sRGB mix look darker in the middle?

sRGB values are gamma-encoded: halfway between two numbers is not halfway in light. Averaging them undershoots the brightness of the true midpoint, which is why blends in sRGB look muddy. Linear sRGB, OKLab and OKLCH do not have that problem.

Which space should I use?

OKLCH for vivid gradients and mixing distinct hues; OKLab for tints and shades of one colour, where you want a straight, even path. Those two cover almost every design use.

Is color-mix() safe to use in production?

Yes — it is supported in all current versions of Chrome, Edge, Firefox and Safari. For very old browsers, use the hex result written above it as a fallback declaration.

Related tools

More Colors & Design tools