ToolNimba

๐ŸŽจ Color Mixer: Blend Two Colors and Get the Hex Code

Shihab Mia By Shihab Mia ยท Updated 2026-07-01

100% A 50% B 100% B

Color A

#FF0000

Result

#800080

Color B

#0000FF

Result: #800080 rgb(128, 0, 128)

Pick two colors, drag the slider, and the blended hex updates instantly.

A color mixer blends two colors and returns the exact hex and RGB of the result. Pick Color A and Color B, then set the mix ratio to control how much of each goes into the blend. The tool interpolates the red, green, and blue channels for you and shows a live swatch, so you can copy the mixed color straight into CSS, a design file, or a palette without doing any math by hand.

What is the Color Mixer?

Mixing colors on a screen is not the same as mixing paint. Paint is subtractive: pigments absorb light, so combining many of them drives the result toward a muddy brown or black. Screens are additive, working in the RGB model where each pixel emits red, green, and blue light. This tool blends in RGB space, which is the natural model for anything you will display digitally, and it matches how CSS, browsers, and most design tools mix by default.

The blend itself is a straight linear interpolation done one channel at a time. For each of the red, green, and blue channels, the result is the Color A value scaled by one minus the mix amount, plus the Color B value scaled by the mix amount, then rounded to a whole number from 0 to 255. With the ratio in the middle you get the exact halfway point between the two colors. Slide it toward one end and the result leans toward that color; at the extremes you get one of the original colors back unchanged.

Because the mix is a weighted average, the ratio is fully continuous. A 25 percent setting means the result is three parts Color A to one part Color B, which is exactly how you build a tint or a subtle wash. Repeating the blend at evenly spaced ratios (for example 0, 25, 50, 75, 100 percent) gives you the intermediate stops of a two-color gradient or a small palette ramp, so the mixer doubles as a quick way to generate a color scale by hand.

There is one honest caveat about pure RGB averaging. Standard hex and RGB values are gamma-encoded (sRGB) rather than linear light, and the human eye is more sensitive at the dark end of the range. As a result the numeric midpoint (128) only produces roughly 20 percent of full luminance, not 50 percent, so the middle of a blend between two vivid colors can look a touch darker or duller than a perfectly perceptual mix. Advanced tools sidestep this by converting to linear RGB or OKLab, blending there, and converting back. For everyday design work, palette steps, hover states, and tint or shade estimates, plain RGB mixing is fast, predictable, and more than accurate enough, and it is the behavior most other software produces too.

To lighten a color, mix it toward white; to darken it, mix it toward black; to desaturate or tone it down, mix it toward a neutral grey. Setting one input to a near-neutral and nudging the ratio is the simplest way to derive a whole family of tints and shades from a single brand color, all of which stay mathematically consistent with the original.

When to use it

  • Finding a color halfway between two brand shades to use as an accent, border, or hover state.
  • Creating tints and shades by mixing a base color with white or black at different ratios.
  • Generating the intermediate steps of a two-color gradient or a small palette ramp by hand.
  • Toning down a loud color by blending a small amount of neutral grey into it.
  • Deriving a readable "muted" variant of a color for disabled buttons or secondary text.
  • Checking what two colors average to before committing them to a design system.

How to use the Color Mixer

  1. Set Color A using the swatch picker or by typing a hex code.
  2. Set Color B the same way, or use white or black to make tints and shades.
  3. Drag the mix ratio slider toward Color B to control the balance of the blend.
  4. Read off the resulting hex and RGB value and check the live swatch.
  5. Press Copy hex to paste the mixed color into your CSS or design tool.

Formula & method

For each channel: result = A * (1 - t) + B * t, where A and B are the channel values (0 to 255), t is the mix ratio as a fraction (0 to 1), and each result is rounded to the nearest whole number.
How a Color Mixer Blends Two ColorsColor A#FF0000Color B#0000FFratio 0% to 100%50% mixresult = A * (1 - t) + B * t -> #800080

Worked examples

Mix red (#FF0000) and blue (#0000FF) at a 50% ratio to find the midpoint.

  1. t = 50 / 100 = 0.5
  2. Red channel: 255 * 0.5 + 0 * 0.5 = 128
  3. Green channel: 0 * 0.5 + 0 * 0.5 = 0
  4. Blue channel: 0 * 0.5 + 255 * 0.5 = 128
  5. Combine (128, 0, 128) into hex

Result: Result is #800080, a purple, rgb(128, 0, 128)

Lighten red (#FF0000) by mixing in white (#FFFFFF) at a 25% ratio.

  1. t = 25 / 100 = 0.25
  2. Red channel: 255 * 0.75 + 255 * 0.25 = 255
  3. Green channel: 0 * 0.75 + 255 * 0.25 = 64
  4. Blue channel: 0 * 0.75 + 255 * 0.25 = 64
  5. Combine (255, 64, 64) into hex

Result: Result is #FF4040, a soft red tint, rgb(255, 64, 64)

Tone down a bright teal (#00C8C8) by mixing 40% neutral grey (#808080) into it.

  1. t = 40 / 100 = 0.4
  2. Red channel: 0 * 0.6 + 128 * 0.4 = 51
  3. Green channel: 200 * 0.6 + 128 * 0.4 = 171
  4. Blue channel: 200 * 0.6 + 128 * 0.4 = 171
  5. Combine (51, 171, 171) into hex

Result: Result is #33ABAB, a calmer, less saturated teal, rgb(51, 171, 171)

Mixing red (#FF0000) toward blue (#0000FF) at different ratios

Ratio toward BRGB resultHex result
0% (all A)rgb(255, 0, 0)#FF0000
25%rgb(191, 0, 64)#BF0040
50%rgb(128, 0, 128)#800080
75%rgb(64, 0, 191)#4000BF
100% (all B)rgb(0, 0, 255)#0000FF

Common two-color blends at a 50% ratio

Color AColor B50% result
#FF0000 red#FFFF00 yellow#FF8000 orange
#FFFFFF white#000000 black#808080 grey
#0000FF blue#FFFF00 yellow#808080 grey
#00FF00 green#0000FF blue#008080 teal
#FF0000 red#FFFFFF white#FF8080 pink

Building tints and shades of blue (#0066CC)

MixRatioResult
toward white (#FFFFFF)25%#408CD9 (light tint)
toward white (#FFFFFF)50%#80B3E6 (pale tint)
base color0%#0066CC
toward black (#000000)25%#004D99 (shade)
toward black (#000000)50%#003366 (deep shade)

Common mistakes to avoid

  • Expecting screen mixing to match paint. Mixing blue and yellow light on a screen gives a grey, not green, because screens add light rather than subtract pigment. If you are trying to reproduce a physical paint result, RGB mixing will not match it.
  • Assuming the midpoint looks like the visual average. A plain RGB midpoint can appear slightly darker or duller than expected because the values are gamma-encoded (sRGB). The number is correct, but trust your eye for fine palette work and nudge the ratio if needed.
  • Typing an invalid hex code. A hex color needs exactly three or six hex digits (0 to 9 and A to F), optionally with a leading hash. Something like #12 or #GGGGGG will not parse, so the result will not update.
  • Forgetting the ratio direction. The slider measures how much of Color B is in the mix. At 0% you get Color A, at 100% you get Color B. Sliding the wrong way gives you the opposite balance of what you intended.
  • Using pure black or white to tint when you wanted a warmer result. Mixing toward pure white or black shifts lightness but can flatten a color. For a warmer tint, mix toward a warm off-white; for a richer shade, mix toward a very dark version of the same hue instead of black.

Glossary

Hex code
A six-digit color value written as a hash followed by red, green, and blue pairs in base 16, such as #FF8000.
RGB
The additive color model used by screens, describing a color by its red, green, and blue components, each from 0 to 255.
Linear interpolation
Blending two values in a straight proportion; here, mixing each color channel by the chosen ratio.
Mix ratio
The fraction of Color B in the blend, from 0 (all Color A) to 100 percent (all Color B).
Tint
A lighter version of a color, made by mixing it with white.
Shade
A darker version of a color, made by mixing it with black.
Additive mixing
Combining colored light so channels add together, the model screens use; red plus green light gives yellow.
Gamma (sRGB) encoding
The non-linear way hex and RGB values map to light, which is why a numeric midpoint can look darker than the true perceptual average.

Frequently asked questions

How does this color mixer blend two colors?

It works in RGB space, blending the red, green, and blue channels separately. For each channel the result is the Color A value times one minus the ratio, plus the Color B value times the ratio. The three results combine into the final hex and RGB color.

What does the mix ratio slider do?

The slider sets how much of Color B is in the blend, from 0 to 100 percent. At 0 percent you get Color A unchanged, at 100 percent you get Color B, and at 50 percent you get the exact midpoint of the two colors.

Why does mixing blue and yellow give grey instead of green?

Screens use additive color, where light is combined rather than pigment. Blue and yellow light add up to a neutral grey. The green you get from mixing blue and yellow paint comes from subtractive pigment mixing, which is a different model.

How do I make a lighter or darker version of a color?

Set your base color as Color A. To lighten it, set Color B to white (#FFFFFF) and slide the ratio up for a stronger tint. To darken it, set Color B to black (#000000) and slide toward it for a deeper shade.

Can I mix more than two colors?

This tool blends two colors at a time. To combine three, mix the first two, copy the result into one of the inputs, and then mix that against your third color. Repeat to fold in as many colors as you need.

How do I use the mixer to build a gradient or palette?

Keep the same two colors and read off the result at evenly spaced ratios, for example 0, 25, 50, 75, and 100 percent. Those five hex values are the intermediate stops of a smooth two-color gradient or a small color ramp.

Is the mixed color exactly the visual average?

It is the exact numeric average of the channel values at the chosen ratio, which is how most CSS and design tools mix by default. Because the values are gamma-encoded, the midpoint can look a touch darker than a perfectly perceptual blend, so adjust by eye for fine work.

What is the difference between RGB mixing and OKLab or perceptual mixing?

RGB mixing averages the raw sRGB numbers, which is simple and matches most tools. Perceptual methods like OKLab convert the colors first so lightness and saturation stay even across the blend, which keeps midpoints looking more vivid. For most design work the RGB result is close enough.

Can I mix RGBA colors with transparency?

This mixer blends solid RGB colors and returns a solid hex. To combine a semi-transparent color over another, you would also blend the alpha and account for how much of each layer shows through, which is a separate calculation from a simple two-color mix.

Does the order of Color A and Color B matter?

Only in how the ratio reads. Swapping A and B and flipping the ratio (for example 30 percent becomes 70 percent) gives the same result, because the blend is a symmetric weighted average of the two colors.

Sources