What Does the Colour Mix Calculator Do?
This colour mixer calculates the colour you get when you blend two colours together in a chosen ratio, for example 70% navy with 30% gold. It's the digital equivalent of mixing paint on a palette, and it's useful for creating in-between shades, hover and disabled states, brand colour variations, data-visualisation ramps, overlays and themes. Instead of guessing HEX codes, you get the exact result and can copy it instantly.
What most mixers don't tell you is that there are several ways to blend colours on screen, and they give noticeably different results. This tool shows all four side by side, so you can pick the blend that looks right.
How to Mix Two Colours
- Enter Colour A and Colour B in any format (HEX, RGB, HSL or names), or use the pickers.
- Drag the ratio slider to choose how much of each colour to use.
- Choose the blending method. OKLab is a great default.
- Copy the result as HEX, RGB, HSL or CSS
color-mix(), or click any step in the blend strip.
Four Ways to Blend Colours
| Method | How it works | Result |
|---|---|---|
| sRGB | Averages the RGB numbers directly | What most tools do. Midpoints can look dark or muddy (blue + yellow = grey). |
| Linear light | Converts to linear light, mixes, converts back | How light physically combines. Brighter midpoints, like blurred or anti-aliased edges. |
| OKLab | Mixes in a perceptually uniform space | Even-looking steps. The best general choice for UI and gradients. |
| OKLCH | Mixes lightness, chroma and hue, taking the shortest way round the wheel | Keeps colours vivid. Blue + yellow passes through green instead of grey. |
Why Isn't Blue + Yellow Green?
In paint, blue and yellow make green because pigments subtract light: yellow paint absorbs blue light, blue paint absorbs red and some green, and the only light both reflect is green. Screens add light instead. Averaging blue (0, 0, 255) and yellow (255, 255, 0) in RGB gives (128, 128, 128), a flat grey. That's mathematically correct for light, but not what artists expect. The OKLCH method gets closer to the painter's intuition by travelling around the hue wheel from blue to yellow through green. True pigment simulation needs spectral models (like the Kubelka–Munk theory used by paint manufacturers), so treat any screen mix as a guide rather than an exact paint recipe.
Mixing Colours in CSS with color-mix()
Modern CSS can mix colours natively in every current browser:
background: color-mix(in oklab, #0047AB 50%, #FFD700);
The first argument is the colour space (srgb, srgb-linear, oklab, oklch and others). Each colour can have a percentage; if only the first has one, the second gets the remainder. It works with CSS variables, which makes it perfect for theme tokens: color-mix(in oklab, var(--brand) 85%, black) gives a darker hover colour, and color-mix(in srgb, var(--brand) 15%, transparent) gives a subtle tinted background. The calculator writes this code for you, matching the method you picked.
Practical Uses
- Hover and active states: mix your brand colour with 10–20% black or white.
- Tinted backgrounds: mix 5–10% of a colour into white for calm section backgrounds.
- Chart ramps: use the blend steps between two colours for ordered categories or heat maps.
- Brand harmony: mix a little of your primary colour into your greys for a cohesive, warm or cool neutral palette.
- Matching overlays: find the solid colour a semi-transparent layer produces (see also the Opacity Calculator).
Features
- Any ratio0–100% slider.
- Four blend methodssRGB, linear, OKLab and OKLCH.
- Side-by-side comparisonAll methods at once.
- Blend strip3–21 in-between colours.
- CSS color-mix()Ready-to-paste code.
- Any input formatHEX, RGB, HSL and names.
Mixing for Hover States
A quick recipe for consistent interactive states is to mix your base colour with 12% black for hover and 20% black for pressed. In CSS: color-mix(in oklab, var(--brand) 88%, black).
Frequently Asked Questions
What colour do red and white make?
Pink. At 50/50 in sRGB it's #FF8080, and more white gives a paler pink.
What is the average of two hex colours?
Average each channel: #FF0000 and #0000FF average to #800080 (purple) in sRGB.
Which blending method should I use?
OKLab for most design work, OKLCH for vivid gradients, and sRGB to match older tools and browsers.
Does color-mix() work in all browsers?
Yes, in all current versions of Chrome, Edge, Firefox and Safari (since 2023).
Can I mix more than two colours?
Mix two first, then mix the result with the third colour.