How does a screen make millions of colours from just three?
Every dot on your phone screen is a tiny trio of lamps: red, green and blue. Mix their light on a black screen and find out how yellow appears when there is no yellow lamp at all.
Controls
Watch it work
A short film of this machine in action. Watch it, then try the challenges yourself.
What you're seeing
Three spotlights shine on a black screen: one red, one green, one blue. Each spot shows its own colour. Where two spots overlap, their light adds together and makes a new colour. In the middle, all three lights land on the same place.
Each lamp has a dimmer box in front. Its brightness is a number from 0 (off) to 255 (full), and the eight little switches show that number in binary, just like the rockers in the marble adder. The window under the screen shows the code a computer uses for the colour in the middle.
Try this
0 of 4 solved- Make yellow light in the middle. There is no yellow lamp. Which two lamps do you need?Turn one lamp off completely.
- Now make cyan (sky blue-green) and then magenta (pink-purple). Each one needs two lamps at full.Cyan has no red in it; magenta has no green.
- Make a grey that is not black or white.All three lamps at the same, middle brightness.
- Match the colour code #FF8800, an orange. The code is red, green, blue: FF, 88, 00.FF is 255 and 88 is 136. Blue off.
Why it works
Light adds up. Your eye has three kinds of colour sensors, tuned roughly to red, green and blue light. Yellow light tickles the red and green sensors together, so red light plus green light tickles them in the same way, and your brain sees yellow. Screens use this trick: they never make yellow light, they fool your eyes with red and green.
This is the opposite of mixing paint. Paint takes colours away (it absorbs light), so mixing all paints gives a muddy dark colour. Mixing all lights gives white. That is why a screen starts black when everything is off and turns white when all its lamps are full.
A computer stores each lamp's brightness as one byte: eight bits, so 256 levels from 0 to 255. Three bytes per dot gives 256 × 256 × 256 = 16,777,216 possible colours.
Go deeper AGES 14–16
Each lamp's level is one byte. Programmers write it in hexadecimal (base 16, digits 0–9 then A–F), because one byte is always exactly two hex digits. A colour code is just the three bytes in a row: #RRGGBB.
On your bench right now:
Green 255 = 1111 1111 = FF
Blue 255 = 1111 1111 = FF
code #FFFFFF, looks white
Each group of 4 bits is one hex digit, which is why programmers like hex: you can read the switches straight off. Your eye is far more sensitive to green than to blue, so the same setting looks much brighter in green. Screens weigh the three colours as roughly 21% red + 72% green + 7% blue when they work out brightness: right now that comes to 255 out of 255.
16,777,216 colours is about as many as most people can tell apart, which is why this "24-bit colour" became the standard for screens.