· 4 min read
How to Blend Two Hex Colors at Any Ratio
Heshan Fernando
Co-founder & COO
You’ve got a brand blue and a brand orange, and you need something in between for a gradient step or a hover state — not a 50/50 average that looks muddy, but a genuine, usable intermediate color. Guessing HEX values by eye rarely lands right, and a naive average of two HEX codes (just averaging the R, G, and B numbers directly) often produces a duller, greyer result than you’d expect.
That gap between “the math I can do by hand” and “the color that actually looks right” is where a lot of design time gets wasted nudging sliders in a color picker, eyeballing it against the two source colors, and hoping it holds up once it’s actually placed next to them.
What blending two colors actually involves
Simple HEX averaging — taking the midpoint of each RGB channel — is the most common approach, but it operates on gamma-encoded values, which is not how light actually mixes. The result tends to look darker and duller than a true visual blend, especially with colors that are far apart on the color wheel.
Linear-light mixing corrects for this by converting each color into linear color space before blending, then converting back to standard RGB/HEX for output. It’s more computation, but it produces a blend that looks closer to how two light sources or two paints would actually combine — brighter and more natural than a naive average.
Why people get stuck here
- Naive averaging looks muddy. A straight midpoint of two HEX values often skews darker and less vibrant than expected, especially with saturated colors.
- Ratio control is missing. Many simple mixers only do a 50/50 blend and don’t let you dial in a 70/30 or 20/80 mix for a gradient step or a tint variant.
- No instant feedback. Testing color combinations by hand-editing HEX codes and reloading a design file is slow, especially when iterating through several ratios.
- RGB vs. HEX output confusion. Some workflows need HEX, others need RGB — switching between the two by hand invites transcription errors.
What a good color mixer looks like
Linear-light blending, not naive averaging
The blend should account for how color actually mixes visually, producing a result that looks like an intermediate step, not a desaturated compromise.
Adjustable mix ratio
You should be able to set any ratio between the two colors, not just a fixed 50/50 split, so you can generate a full gradient sequence step by step.
Instant HEX and RGB output
The result should be copy-ready in both formats immediately, since different tools and codebases expect one or the other.
Common mistakes to avoid
- Using a plain RGB average when you need a visually accurate blend — it works fine for quick approximations but not for polished design work.
- Only testing a 50/50 mix when what you actually need is a specific step in a gradient, like a 25% or 75% blend.
- Picking blended colors in isolation from the two source colors, without checking how they read together in the actual layout.
- Forgetting that a blend between two brand colors might not itself meet accessibility contrast requirements — check contrast separately if the blended color is used for text.
How to do it with the Color Mixer
Online Tool Store’s Color Mixer blends two HEX colors instantly in your browser using linear-light mixing.
- Enter your two starting HEX colors.
- Set the mix ratio — anywhere from mostly one color to mostly the other.
- See the blended result update instantly, with HEX and RGB values shown.
- Copy whichever format you need for your design tool or codebase.
Because the blend updates live as you adjust the ratio, it’s fast to generate a full set of gradient steps between two brand colors.
Frequently asked questions
Why does a simple HEX average look worse than a proper color blend?
A plain average operates on gamma-encoded RGB values, which don’t correspond directly to how much actual light is being mixed — the result tends to look darker and less vibrant. Linear-light blending converts to linear space first, producing a result closer to how the colors would visually combine.
What ratio should I use for a gradient?
For a smooth gradient with several steps, generate blends at even intervals — like 25%, 50%, and 75% — between your two endpoint colors, rather than jumping straight from one color to the other.
Can I use this to create tints and shades of a single color?
This tool is built for blending two distinct colors together; for tints (mixing toward white) or shades (mixing toward black) of a single color, blend your color against white or black as the second input.
Final thought
A quick eyeball guess between two HEX values usually gets you close, but “close” shows up as a slightly off gradient step once it’s live — a proper linear-light blend gets it right the first time.