Color Mixer

Blend two colors together at a given ratio.

%
Result
Mixed Color
#95639d
Mixed RGB
rgb(149, 99, 157)
Color A#3b82f6
Color B#ef4444
Mix Ratio50%

About This Tool

Blends two input colors at a chosen ratio and returns the resulting hex, RGB, and HSL values. Mixing happens in RGB space by linear interpolation of the channel values, weighted by the slider position.

Perceptual color spaces such as LAB or OKLab produce smoother gradients but require gamma decoding. The RGB approach used here is fast and matches how most CSS gradients are rendered.

The interpolation is straightforward: for a ratio t between 0 and 1, each output channel equals (1−t)·channel_A + t·channel_B. With t = 0.5, the result is the arithmetic mean of the two colors' red, green, and blue values. The mixed value is then re-serialized to a six-digit hex string and converted to HSL via the standard RGB-to-HSL transform. The HSL output is informational; mixing in HSL space directly produces different and often less expected results because hue interpolates around a circle.

A worked example: mixing #FF0000 (pure red) and #0000FF (pure blue) at 50% gives #800080, the dark purple at the midpoint of the RGB cube's red-blue diagonal. Mixing the same pair in OKLab would yield a brighter, more saturated magenta because OKLab interpolation respects perceptual lightness. The visual difference is small for similar colors and large for complementary pairs. CSS gradients use the sRGB linear path by default, so the RGB mix here matches what a browser draws between the same two stops.

Limitations follow from the choice of color space. Pure RGB interpolation passes through grey for complementary colors, which can look muddy. Mixing yellow (255,255,0) with blue (0,0,255) gives (128,128,128), a flat grey, because the additive light model has no concept of subtractive pigment behavior. For paint or print mixing, no screen-based tool gives correct results; CMYK ink mixing has its own physics. Alpha is interpolated linearly when both inputs include it; otherwise both are treated as fully opaque. Gamma correction is not applied, so very bright and very dark colors can produce darker midpoints than the eye expects.

For cases where perceptual smoothness matters, OKLab and OKLCh have become the de-facto standard in modern design tooling, and CSS Color Module Level 4 supports them via color-mix(in oklab, ...). Browsers shipping that syntax will render gradients between the same two stops with notably different midpoints than the legacy sRGB path.

The about text and FAQ on this page were drafted with AI assistance and reviewed by a member of the Coherence Daddy team before publishing. See our Content Policy for editorial standards.

Frequently Asked Questions

How is the mix calculated?
Each channel of the output is a weighted average of the corresponding channels in the two inputs. A 50/50 ratio yields the arithmetic mean of red, green, and blue values, then converted back to hex.
Why does mixing yellow and blue not give green?
RGB is an additive light model. Mixing yellow (255,255,0) and blue (0,0,255) produces a desaturated grey. Subtractive pigment mixing, which gives green, behaves differently and is not what screens use.
Does the tool support alpha channels?
Alpha is preserved if both inputs include it; otherwise opaque colors are assumed. The alpha channel is interpolated linearly along with RGB.
What about LAB or OKLab mixing?
Those produce more perceptually uniform blends but require additional conversion steps. RGB mixing is used here for speed and parity with browser gradient rendering.
Why does the midpoint look darker than expected?
sRGB values are gamma-encoded, not linear-light. Linear interpolation between encoded values produces a darker visual midpoint than perceptually correct mixing. The effect is most visible between bright saturated complementary colors.
Can three or more colors be blended?
Not directly. The interface accepts two stops. To blend three colors, mix the first pair, then mix that result with the third, choosing ratios that approximate the target weights. CSS color-mix() chains the same way.
Is this the same as CSS color-mix()?
The default path matches CSS color-mix(in srgb, ...). The CSS function also supports oklab, oklch, hsl, and other spaces with different interpolation semantics. Browsers shipping CSS Color 4 produce noticeably different midpoints in those modes.
Why are HSL values shown?
Informational. The mix itself happens in RGB; HSL is computed from the result for users who think in hue/saturation/lightness terms. Editing HSL of the output won't round-trip back to the same RGB midpoint.
How does mixing differ from blending modes?
Color mixing produces a single output color from inputs at a fixed ratio. CSS blending modes (multiply, screen, overlay) combine layers per-pixel based on the underlying color values, producing a result that varies across the composite. Different operations entirely, despite both being color combinations.