We all like some color in our lives. But what is it: an objective feature of worldly things, or a subjective experience of our eyes and minds?

While the question sinks in, let’s see if we can enumerate all the possible colors. A simple list won’t do, because we often think of colors as transitioning through a continuum of shades. Luckily, our elementary schools prepared us well for this task. We learned that all colors can be made by mixing three special primary colors in various proportions. They are red and blue, and also… hold on, was the third one green or yellow?

Part I: Primary Colors

You likely saw a diagram like the following in an art class:

RYB Diagram

We were taught that it’s possible to start with three types of crayon or paint, and derive all the other colors by mixing them. Seems simple enough. But if you studied human vision or web design, you probably saw a different diagram:

RGB Diagram

This one is based on the finding that most people’s eyes contains three types of cone cells, sensitive to light with long, medium and short wavelengths. These wavelengths correspond roughly to the sensation of red, green and blue. When we perceive other colors, it’s supposedly because a mixture of wavelengths are entering our eye.

As if amused by our confusion, a physics teacher now comes along and drives us into madness with yet another diagram:

EM Spectrum

It turns out there’s a physical phenomenon called electromagnetic (EM) radiation. When the wavelength is very long, we call them radio waves. When the wavelength is very short, we call them gamma rays. Both are invisible. Somewhere in the middle, there’s a narrow band that excites our eyes’ cone cells; we call it light.

Check it out: there are no primary colors in this description! There are no discrete buckets of long, medium and short waves: only a continuum, a rainbow of colors. Indeed, rainbows occur when mixed (white) light is reflected in a wavelength-dependent manner.

Jeez, our teachers contradicted each other! What’s up with that?

If there’s one lesson to take away here, it’s to stay awake in class, and in life! Actively check for connections between your lessons. When you find something that smells like a contradiction, take it seriously. Don’t brush it off! Treat it like a puzzle. It means you haven’t found the truth yet, and it will help point the way for you. Taking this technique to heart will turbocharge your learning.

Part II: Cone Cells

Alright, so the physics part of our investigation was pretty easy. You’re welcome to read more about how EM works, but there’s no need. The EM diagram gives us the right idea: light is just EM radiation whose wavelength happens to fall within the visible range. The complications come not from the physics of EM, but from biology.

Before looking up the full answer, let’s imagine how color perception might work. We know that we’re capable of seeing an infinite variety of light: namely, the continuum of wavelengths known as the visible spectrum. We perceive this spectrum as varying continuously from deep red, slightly orangish red, orange-red, reddish orange, orange, golden orange, golden yellow, and so on down to all the colors of the rainbow. These are the spectral colors, produced by monochromatic light, meaning it’s composed purely of a single wavelength.

By mixing the spectral colors, it’s possible to get non-spectral colors that don’t appear on the rainbow, such as white and magenta. With an infinite variety of pure spectral colors available, the possible combinations we can make with them boggle the mind! However, our eyes cannot tell all of them apart. For example, mixing red and green produces yellow, whose appearance is similar to pure yellow light.

Our limitation stems from the three types of cone cells. The visual system doesn’t work with the full spectral power distribution, which is what we call the complete breakdown of light intensity over all wavelengths. Instead, color is essentially derived from three numbers, corresponding to the amount of activation for each cone type.

How do three types of cones accomodate the continuous physical spectrum? Since we’re able to able to perceive the entire visible band of EM, it must be the case that our three types of cones together cover this entire range. Indeed, here’s a graph plotting the sensitivities of our cells:

Cone Sensitivity

There are three curves, corresponding to the three cones. The horizontal axis corresponds to wavelength, and the height of a curve at each position tells us how sensitive the cone is to that wavelength. As we can see, one type of cone (let’s call it R) peaks in the red-to-yellow range, one (G) in the green and one (B) in the blue. We also see that monochromatic yellow light activates both R and G cones, with almost no activation of B, resulting in a subjective appearance that’s very similar to mixing red and green light together. Different spectral distributions that appear the same are called metamers.

Some activations cannot be achieved by monochromatic light. For example, equal activation of all three cone types, which gives the subjective appearance of white, cannot be achieved by any single wavelength.

Color, therefore, is our visual system’s subjective experience of various mixtures from the visible EM spectrum. Armed with this insight, can we draw a new diagram that includes all possible colors, including the non-spectral ones?

Part III: Color Space

It’s impossible to display all the colors on one axis or line. This was possible with the EM spectrum, where the only parameter was wavelength. To describe the cone activations, we need not one but three numbers: the amount of R, G and B activation. If we let the x, y and z axes correspond to cone activations, ranging from zero to maximum, we end up with the Cube of All Colors:

RGB Cube

Or do we? Alas, this cube is a fake! Looking back to the cone sensitivity graph, you’ll notice that it’s impossible to get a pure G activation without also getting a bit of R or B activation. If you could magically activate only your G cones, you would experience a color that doesn’t exist in the real world. Some parts of the cube correspond to imaginary colors, which no mixture of light can produce. All the real colors are contained in some carved out portion of the cube.

Let’s simplify. Every point that’s hidden from view in this image of a cube (e.g., the back and interior) is just a dimmer version of a color on the surface. If we don’t care about brightness, we can take a slice of the cube that represents all its colors at a fixed level of brightness. As a result, we only need two numbers to describe any color1, and we can draw the color space on a flat screen or sheet of paper.

Thanks to an empirical result known as Grassman’s law, it’s possible to construct this space in such a way that, when light of any two colors are mixed, the resulting color lies on the line segment between them. To avoid some math, let’s just take this fact for granted. Even with this restriction, there are many ways to place the x and y axes. The most popular choice is set by the CIE 1931 standard:

Color Gamut

Remember that all we’ve done is project the color cube onto a flat plane. Why the triangular and horseshoe shapes? Let’s explore whether this makes sense.

Given any spectral distribution, our handy cone sensitivity graph enables us to calculate the corresponding cone activations, which we can then project into (x,y) coordinates according to the CIE standard. Which positions on the CIE chart do the spectral colors occupy? Try to convince yourself that they will form an unbroken continuous curve. For a hint, look up the formal mathematical definition of a continuous function. I won’t give the formal proof here, but here’s an intuitive sketch:

Let’s start from the shortest visible wavelength, and find its place on the CIE chart. Then, let’s gradually increase the wavelength. Our cone sensitivity chart shows a smooth dependence on wavelength. Therefore, a sufficiently tiny change in wavelength causes a tiny change in cone activations, which remains a tiny change after projecting to CIE. As we visit all the wavelengths from blue to red, we’ll trace out a continuous curve in CIE space.

What about the non-spectral colors? Grassman’s law makes this easy for us: mixing can only produce colors that lie between the existing colors. It follows that, given any set of starting colors, their possible combinations will take up the convex hull of the starting set. In geometry, the convex hull of a set is defined to be the smallest convex shape that contains the set. If we place thumbtacks all over the starting set, the convex hull is enclosed by a thin rubber band that tightly surrounds the thumbtacks.

The CIE “horseshoe” is simply the convex hull of our spectral curve. The most saturated-looking colors are on the boundary, which consists of the spectral colors as well as the famous line of purples that connects its endpoints. These purples are non-spectral, so they don’t appear in rainbows! The horseshoe contains every color that your eye can see. The “imaginary colors”, which cannot be produced by any light, lie outside the horseshoe. Beautiful!

Finally, in case you were wondering, the black interior curve corresponds to the spectrum emitted by a blackbody, an object that absorbs all incoming light. At room temperature, such an object would appear black; approaching 1,000 degrees, it glows red-hot; past 10,000 degrees, it radiates blue-white. The point labeled D65 corresponds to the surface of the Sun. It should come as no surprise that our visual sensitivity evolved to peak at about the same wavelength as sunlight!

Part IV: Color Technology

Scientists propose and test theories to explain how natural things work. Engineers apply theories to design new, useful things. In a way, these activities are inverses of each other. Together, they enable technology: the art of manipulating nature to one’s will.

Having learned the scientific basis for color perception, let’s put on our engineer hats and see what we can do! Video is a technology that convincingly (to a human) reproduces the visual stimulus of a detailed scene. This requires the ability to produce a spectacular variety of colors at a moment’s notice. Ideally, we’d like to control the precise spectral distribution of the light we’re emitting, but there’s no cheap way to get such fine-grained control. Luckily, there’s no need to faithfully replicate the light from a real scene: all it takes is to fool the human eye.

TVs and computer screens can be built from tiny pixels that each emit a dot of one specific color. We can turn each light off, or have it on at any brightness. Since the relative distribution of wavelengths is fixed, we’re anchored to one point of the CIE color space.

White pixels alone give us black-and-white television: just dim the pixels to produce darker shades of grey. Now suppose we had two types of pixels: red and green. By Grassman’s law, adjusting their brightness in different proportions yields a range of hues such as orange and yellow. In color space, we’re capable of representing not just one point, but the entire line segment connecting the two source colors.

In general, the range of colors we can represent will be the convex hull of the source colors. For example, the sRGB standard uses red, green and blue subpixels to produce colors in a triangular region, as drawn inside the horseshoe above. If your monitor is sRGB, it’s incapable of displaying colors outside the triangle. The region outside the triangle but inside the horseshoe corresponds to colors that you might find in the wild, but that your screen cannot display. Due to this limitation, the color space image is actually drawn in the closest color that your screen can display.

It’s often said that red, green and blue are the additive primary colors. Additive refers to the act of mixing colors by emitting, hence adding, different source lights. Colors made from one source light are primary; colors made from an equal mix of two lights are secondary.

Red, green and blue occupy corners of the color space, suggesting their suitability as primary colors. Indeed, if we had those far corners as subpixel primaries at our disposal, we could display much richer colors than sRGB. Nonetheless, the rounded edge of the color space ensures that no finite set of primary colors can fill the entire horseshoe.

If we cheat a bit, we can view the imaginary colors corresponding to pure R, G and B cone activation as primary colors. Together, they form a big triangle that fully contains the horseshoe. Given that we have three cone types, it seems sensible that three primary colors should suffice; unfortunately, any such triplet would necessarily be imaginary!

In retrospect, we can view our elementary school RGB Venn diagram as a simplification of additive color mixing. What about the RYB diagram? That one stems from subtractive color mixing. Unlike TVs, paint and printer inks don’t produce any light of their own. Instead, you shine an ambient light, such as from a bulb or the Sun, on a sheet of paper. The ink absorbs, hence subtracting, selected wavelengths, and reflects the rest.

I don’t feel like digging deep into subtractive mixing, so let’s defer back to the simplified, though technically incorrect, view that light can be discretized into long (red), medium (green) and short (blue) wavelengths. In this simplified model, it follows that the primary subtractive colors correspond to secondary additive colors, and secondary subtractive colors correspond to primary additive colors. This is best explained with pictures:

CMY Diagram

Reflection and Absorption Detail

Indeed, most color inkjet printers have three color inks: cyan, magenta and yellow (CMYK). K stands for black, and is preferable to mixing CMY inks because it’s cheaper and typically yields a deeper, sharper black. Cyan and magenta are sometimes called “process blue” and “process red”, respectively. Thus, you can think of CMY as a modern improvement over the old RYB primaries.

Conclusion

Phew! We covered a lot, but most of it followed logically from Grassman’s law and one key fact: that our eyes detect color using three types of cone cells, each of whose sensitivity peaks at a different wavelength on the EM spectrum. There’s no need to memorize every detail of additive and subtractive color mixing, nor the fact that the visible colors can neatly be represented by the convex hull of a planar curve, of which our TVs are limited to a triangular region. These facts follow by deduction.

For the kids out there, the point is: science is not composed of a laundry list of facts. If it were, technology wouldn’t be nearly as powerful as it is today. By relying less on memorization and more on logical connections, you’ll be able to learn and retain a lot more information. With practice, you’ll be able to reason through new situations and apply your knowledge critically to solve non-textbook problems. As a final note, I believe that critical thinking skills are essential to becoming responsible citizens; perhaps I’ll write about that another time.

I hope you enjoyed this post! There’s a lot more to human color perception than presented here. If you want to learn more, a good place to start is the HyperPhysics Color Puzzles.

If you’d like to read someone else’s explanation of the same topic, check out:

Hey Kids! Red’s Not a Primary!

A Beginner’s Guide to Colorimetry

  1. Note, however, that grey is effectively a darker white, and brown is a darker orange. Our perception makes relative comparisons that take context, light sources and shadows into account. Optical illusions take advantage of this. By necessity, this exposition contains simplifications.