SpunkArt
Color, art and images

How color mixing works on screens and in paint

Mixing light and mixing paint follow opposite rules. Screens add light together, while pigments take light away. This page explains both and shows the exact maths for blending two digital colors.

Two-color mixer

sRGB average

Linear light

Additive mixing: light

A screen pixel is three tiny lights: red, green and blue. Turning more of them on adds energy, so the result gets brighter. Red plus green light gives yellow. Green plus blue gives cyan. Red plus blue gives magenta. All three at full strength give white. This is additive mixing, and RGB values describe it directly.

Subtractive mixing: paint and ink

A pigment looks colored because it absorbs part of the light that falls on it. When you mix two pigments, each one absorbs its share, so less light comes back and the mix gets darker. That is why cyan, magenta and yellow are the printing primaries: each removes one of the screen primaries. Yellow ink absorbs blue, cyan absorbs red, and cyan plus yellow leaves green.

Real paints are messier than this model. Each pigment absorbs a curve of wavelengths, not one clean band, so mixing two bright paints often gives a duller color than the screen preview suggests. For the painter’s side, see the guide to limited paint palettes.

MixLight (additive)Ideal ink (subtractive)
Red + greenYellowDark brown or near black
Cyan + yellowVery pale, near whiteGreen
All primariesWhiteNear black

Blending two screen colors: linear interpolation

To get a color part-way between A and B, take a weighted average of each channel. The weight t runs from 0 (all A) to 1 (all B).

mix = A × (1 − t) + B × t   (for red, green and blue separately)

Example: 30% of #1a5fb4 into #e66100. A = (230, 97, 0), B = (26, 95, 180), t = 0.3.

  • Red: 230 × 0.7 + 26 × 0.3 = 161 + 7.8 = 168.8, rounds to 169
  • Green: 97 × 0.7 + 95 × 0.3 = 67.9 + 28.5 = 96.4, rounds to 96
  • Blue: 0 × 0.7 + 180 × 0.3 = 54
  • Result: rgb(169, 96, 54), which is #a96036, a muted brown-orange

Why the middle can look too dark

The averaging above works on stored sRGB values, which are gamma-encoded. Gamma encoding spends more of the 0–255 range on dark tones, so a stored 128 gives far less than half the light of 255. When you average two bright, different colors in sRGB, the middle sags.

The fix is to convert to linear light first, average there, and convert back. The conversion is the same one the contrast formula uses.

Example: red #ff0000 and blue #0000ff at 50%.

  • sRGB average: red and blue channels are each (255 + 0) ÷ 2 = 127.5, rounded to 128, giving #800080, a dark purple.
  • Linear light: 255 is 1.0 linear and 0 is 0.0, so the average is 0.5. Encoding 0.5 back gives 0.7354 × 255 = 187.5, rounded to 188, giving #bc00bc, a brighter magenta.

Physically, the second answer is closer to what you see when red and blue light overlap at half strength each.

Neither result is wrong. sRGB mixing is what most image editors and older CSS gradients do. Linear mixing matches how light adds. Newer CSS lets you choose the space, for example color-mix(in srgb-linear, red, blue) or color-mix(in oklab, red, blue).

Common mistakes

  • Expecting screen previews to match paint. An RGB average of blue and yellow is a grey, not the green that blue and yellow paint make.
  • Mixing HEX digits as text. Average the decimal values, not the characters.
  • Averaging hue angles directly. The average of 350° and 10° is 0° (red), not 180° (cyan). Hue wraps round.

Questions people ask

Why are there two answers in the mixer?

They use the two methods above. The sRGB result matches most software defaults. The linear-light result matches how light physically adds. Each channel is rounded to the nearest whole number.

Can this predict a paint mix?

No. Paint mixing depends on each pigment’s absorption curve, so no simple RGB formula predicts it. Test real paint on paper.