Three ways colors mix
“Mixing” means three different things, and they give different answers for the same two colors.
- Adding light. Two colored lights shining on the same spot add up. Red light plus green light looks yellow, and red, green and blue light together look white. This is how a screen makes every color from red, green and blue pixels.
- Averaging on screen. CSS
color-mix(), CSS gradients and transitions blend two colors by taking a weighted average of their values in a color space. A 50/50 color blend sits halfway between them, so red#FF0000and lime#00FF00average to olive#808000in sRGB, not the bright yellow you get by adding the lights. - Mixing pigments. Paint gets its color by absorbing some wavelengths of light and reflecting the rest. Mix two paints and the mixture absorbs what both absorb, so it is darker and the result depends on which wavelengths survive. That is why blue and yellow paint make green, while their on-screen average in sRGB is gray
#808080.
Color mixing chart: what two colors make
Each pair below is mixed 50/50 with this tool: as paint, and on screen with color-mix(in oklab, …). A name in brackets means the result is within a deltaE OK of 0.02 of that CSS named color.
| Colors | Paint makes | Paint | Screen (OKLab 50/50) |
|---|---|---|---|
| red + yellow | orange-red | #FF4615 (close to orangered) | #FFA000 (close to orange) |
| blue + yellow | green | #398F54 (close to seagreen) | #6CABC7 |
| red + blue | dark red-purple | #4A182B | #8C53A2 |
| red + white | red | #FF474C | #FFA191 |
| black + white | gray | #A6A6A6 (close to darkgray) | #636363 |
| red + green | brown | #55300B | #A66900 |
| blue + orange | dark green | #3B6C3E | #7D82B5 |
| purple + yellow | orange-red | #DB6948 | #C1907A |
| blue + white | blue | #4886FF | #74A3FF |
| yellow + green | green | #4DC41B | #92BF00 |
| red + black | dark red | #771C1E | #630000 |
| blue + green | dark green | #004F29 | #006A95 |
Complementary paints such as blue and orange are usually said to mix to brown or gray. This model, with these two bright colors, gives a dark olive green (#3B6C3E), and purple and yellow give an orange-red (#DB6948). Real results depend on the pigments and amounts. With real paint, a little black also darkens a mix much more than the model shows, and a strong blue such as phthalo can take over a mix that a weaker blue would not. Food coloring dyes also absorb light, so they mix in a broadly similar way, but they are see-through and results vary by brand.
What colors make brown, purple, green, red, orange and pink?
The paint mixes below are computed with this tool's paint model from the CSS colors named.
- Brown: mix complementary colors, or all three painter's primaries. Red and green make
#55300B(brown), and equal parts of red, yellow and blue make#803A2D(brown). Brown is a dark, dull orange or red. - Purple: red and blue. Equal parts make a very dark
#4A182B(dark red-purple); more blue gives#2F1740(dark purple), and red, blue and white (20/50/30) give#5A3876(purple). On screen,color-mix(in oklab, red, blue)is a lighter purple,#8C53A2. - Green: blue and yellow make
#398F54(green); cyan and yellow make a brighter#4FFF45(green). On screen, blue and yellow average to gray or grayish blue instead. - Red: in the traditional painter's (RYB) model, red is one of the three primaries the other colors are mixed from, so you start from a red paint. In printing, where the primaries are cyan, magenta and yellow, magenta plus yellow makes red; here magenta and yellow (70/30) make
#FE5565(red). - Orange: red and yellow. Equal parts lean red,
#FF4615(orange-red); one part red to three parts yellow gives#FF8C3A(orange). - Pink: red and white, with much more white than red. Red and white 50/50 are still red (
#FF474C); 25/75 make#FF8B9D(pink) and 10/90 make#FFC6D6(pink).
To find a color's complement, use the complementary color finder, and to build a palette from the mix, use the color palette generator.
How the screen mix works
Screen mode follows the color-mix() rules in CSS Color Module Level 5. The percentages are normalized first: if they add up to more than 100% they are scaled down, and if one is left out it gets whatever is left of 100%. If they add up to less than 100%, the colors are still mixed in proportion, but the result becomes partly transparent: color-mix(in srgb, red 30%, blue 30%) is purple with an alpha of 0.6. A mostly see-through color counts for less in the mix (CSS calls this premultiplied alpha).
The color space changes the in-between colors. sRGB averages the HEX channels and tends to give darker, grayer middles. Linear sRGB averages the amount of light, which is closest to blending light physically. OKLab is perceptual, and it is the default in the current spec when no space is given. Older browsers need the space written out, so the tool always includes it. OKLCH moves around the hue circle, keeping colors vivid; shorter (the default) takes the short way round and longer the long way, so red and blue meet at purple one way and at green #008A0E the other.
For three or four colors the tool writes nested two-color color-mix() calls, which work in every browser that supports color-mix() (Chrome 111, Firefox 113 and Safari 16.2 onward). The current CSS Color 5 draft allows one or more colors in a single call, mixed one after another from left to right, and the tool shows that list form too. At the time of writing, MDN's compatibility data lists support for the list form in Firefox 150 and Safari 27 but not yet in Chrome or Edge.
How the paint mix works
Paint mode turns each color into a reflectance curve: how much light it reflects at 38 wavelengths from 380 to 750 nm. The curves come from the open-source spectral.js library, which builds them from seven base curves made with a variation of Scott Burns' method for generating reflectance curves from sRGB colors. The curves are mixed with the Kubelka–Munk theory of paint layers (1931): each curve is converted to an absorption-to-scattering ratio, the ratios are averaged by concentration, and the average is turned back into a curve. As in spectral.js, each color's concentration is its amount squared times its brightness. The mixed curve is then lit with standard daylight (D65) and converted back to sRGB.
Worked example
Mix red #FF0000 and blue #0000FF 50/50.
- sRGB: red is (255 + 0) ÷ 2 = 127.5, which rounds to 128, as does blue, giving
#800080, exactly the CSS color purple. - OKLab: red is (0.6280, 0.2249, 0.1258) and blue is (0.4520, −0.0325, −0.3115). The average is (0.5400, 0.0962, −0.0928), which is
#8C53A2, a lighter, softer purple. - OKLCH, shorter hue:
#B700BE. The exact result is outside sRGB, so the HEX is gamut-mapped; with the longer hue it is green#008A0E. - Paint:
#4A182B, a dark wine purple, because each pigment absorbs much of what the other reflects.
Blue and yellow show the difference most clearly: gray #808080 in sRGB, a light grayish blue #6CABC7 in OKLab, and green #398F54 as paint.
Common mistakes
- Expecting screen mixes to behave like paint. No common CSS color space mixes blue and yellow the way paint does. sRGB and OKLab give gray or grayish blue. Hue-based spaces such as OKLCH or HSL can land on teal or green, but only because of the path around the hue wheel, not because of how pigments work. Use paint mode for paint mixing, and screen mode for code.
- Percentages that add up to less than 100%. In
color-mix()this makes the result see-through. Use percentages that total 100% for a solid color. - Treating paint mode as a recipe. It shows the kind of color pigments make, not the exact shade a given set of tubes will give. Test real paints on a swatch card.