All Tools › Web & Developer

CSS Color Mixer

Blend two CSS colors and get the exact HEX, RGB, and HSL values. Paste hex codes, rgb() strings, or named colors like dodgerblue.

Inputs

—
—
Mix ratio50%
HEX#000000
RGBrgb(0, 0, 0)
HSLhsl(0, 0%, 0%)

How it works

The mixer converts each input color to its RGB components (0–255) using the browser's CSS color parser, which accepts hex, rgb(), and named values. For a ratio t between 0 and 1, it computes each output channel with linear interpolation: R = R₁·(1−t) + R₂·t, and likewise for G and B. When HSL mode is selected, the colors are first converted to hue, saturation, and lightness, then each component is interpolated separately — hue takes the shortest angular path around the 360° circle. The blended result is finally converted back to HEX, RGB, and HSL strings ready for CSS.

Frequently asked questions

What color formats does the mixer accept?

You can use 3- or 6-digit hex codes (with or without the #), rgb() or rgba() strings, and any named CSS color like red, dodgerblue, or rebeccapurple. Invalid input shows a warning so you can fix it.

Should I mix in RGB or HSL?

RGB interpolation produces a straight-line blend between the two channel values and is the default. HSL interpolation tends to feel more natural for humans because hue travels the shortest path around the color wheel, keeping saturation and brightness more consistent mid-mix.

Can I use the output directly in CSS?

Yes. The HEX, RGB, and HSL strings are copied straight to your clipboard and are ready to paste into any stylesheet, Tailwind config, CSS variable, or design token file.

Related tools

Free tools by TUNA — energy supply from vetted manufacturers