Just What The Hell Is Color?
Just what the hell is color?
For my first article in the “Just What The Hell Is…” series, I tackle the seemingly-trivial topic of Color. As in, why things look red, green, periwinkle, etc.
Now I’m an educated guy – science, art, even science. But I got to thinking – we all know about the spectrum of colors, and that each color has its own particular wavelength of light. Red is about 700 nanometers, green is ~550 nanometers, and so on. That’s pretty standard science education stuff. So when photons of exactly 550 nanometers hit my eyeball, I see the color “green”. Makes sense. But what happens when I mix blue and yellow paint together? I know “blue and yellow makes green”, but how exactly does a mixture of blue photons (450 nm) and yellow photons (580 nm) look the same to my brain as green photons (550 nm)? I mean, I’ve been mixing paint all my life (it’s relaxing, that’s why), but… Just how the hell does yellow and blue make green?
The answer? Linear algebra.
Its not like an object is inherently “red”. Eyeballs aside, red light is not that much different than green light, just a slightly different wavelength. A few dozen nanometers difference is a pittance compared to the range of the electromagnetic spectrum – hell, AM radio waves are thousands of feet long. Yet these small differences in length matter quite a bit to our eyes. Stretch out red light by a few nanometers and it becomes completely invisible to our eyes (infrared). A great deal of what makes color work occurs in our brains, in the realm of neuroscience, not physics – and as it turns out, neuroscience not physics is responsible for why yellow and blue makes green.
Even though we can see millions of different colors, our eyeballs have only three types of color-sensitive retinal cells (the “cones”) that are tuned toward particular colors. You’ve probably heard of them. Each of the three types of cone cells have their own “favorite” light wavelength they are most sensitive to. For example, the one commonly called “red” is actually most sensitive to greenish-yellow light. They’re called “short”, “medium”, and “long” cone cells after the size of their preferred light waves.
By themselves, these cone cells don’t “see” color – it’s not as though if you suddenly lost medium and long, your remaining short cones would see the entire world as greenish yellow. You’d see black and white only. (In fact this is what happens in color blindness, of which more later.) The “color” arises in your brain, when your brain sorts out how much signal its getting from all three cones at the same time. If it sees that the L cones are getting a ton of signal, but M less and S not at all, it knows you’re seeing “red.” If all of them are getting high signal, you’re seeing “white”. It’s the pattern of intensity from all three that gets mapped in some funny way to a single apparent color.
Now comes the math
The color your brain sees is a linear combination of the signals from the three cone types. Has anyone reading this taken linear algebra? Good. You can put your hands down. Those of you will recognize that what we have here is a vector of intensities for the three cone types, being converted to a single scalar “number” for color. Each cone cell type reports to the brain with how much signal its getting, and the brain adds them together to determine which color that corresponds to.
Now the linear-algebra folks in the audience should be thinking about how 3 numbers (the intensities for each cone type) are being mapped to a one-dimensional output (color) – that means the mapping isn’t one-to-one, isn’t unique for each color. For any color that you see, there are lots of combinations of intensities from the three cone types that our brain perceives as that color. Infinitely many!
So that’s why you can see light at exactly 550 nanometers as green, and also see blue light mixed with yellow light as green. Completely different sets of photons being absorbed by your eye in the two cases, but you see “green” either way. Both of the intensity patterns get mapped to the same color in your brain, even though physically they are completely different.
To get a particular color, you could produce photons of exactly the right frequency that gives you that color (on the spectrum). Or, if you were a reckless bastard, you could mix a handful of other frequencies, and you’ll get exactly the same apparent color. So you can actually generate any color you want by generating a mix of a handful of specific colored-photons in the right proportions. You could pick a handful of convenient wavelengths, and forever more use only that handful of wavelengths to produce any other color you wanted.
How many would you need? In general, three! Because we have three types of cone cells, you’d need three “basic” wavelengths of light, then you could generate any color you want by mixing them in the right ratios. Adding in a little more or less of the three basic wavelengths will change the resulting apparent color of the mix. Kind of like knobs you turn to tune in a radio station. To get any color, you just need to turn the knobs on these three basic colors. A linear algebrist would say that the space is spanned by three colors. Though a linear algebrist might have a hard time saying “algebrist”.
What are these colors? Should sound familiar — we’re talking about the primary colors. Remember that from grade school? You’ve heard that if you have red, blue, and yellow, you can mix them together and get any other color. That’s exactly it! Those three colors are the “basic” wavelengths that you mix in different proportions (e.g. by squishing some more blue into the puddle of tempera paint you dumped on the living room carpet).
But you aren’t stuck with blue, yellow, and red. You could pick other combinations of wavelengths, in fact there’s infinitely many you could pick from. Which you choose is really a matter of convenience for you, not something inherent to the brain. As long as you don’t pick redundant colors (“I choose red, dark red, and red!”), you can pretty much pick any three you want. The common set we’re all familiar with is Red, Blue, and Yellow. But typical computer printers don’t use these, instead going for cyan (a wimpy blue), magenta (purply-pink), and yellow, along with black (the absence of color). Televisions use Red, Blue, and Green, which always baffled me but we’ll get to that in a minute.
Why bother? Why not just make some 420 nm photons when you need “purple”? Well, it’s a practical issue. Do you have any idea how hard it would be to build a TV that shot out “pure” greenish-yellow at exactly the right wavelength when needed? It’s a lot easier to make a TV that can emit only three primary colors, then have it mix them in just the right way to blend into other colors. Then you just have to make light-emitters that handle three wavelengths, instead of hundreds or thousands of wavelengths. Old CRT TVs, if you looked at them closely, you could see the individual little red, green, and blue lights (they were tiny). When you watched a tv show, all that really happened at this tiny level was that the 3 little lights got dimmer or stronger. Same for a printer – if there was no such thing as primary colors, but instead had to make ink that reflected just the right wavelength, your printer would be 30 feet long, filled with cartridges, and you’d go bankrupt buying cartridges for it.
Here’s where it gets cool! (Not really.) Because different animals have different types of cone cells, their view of how colors mix will be different. So to us, a pure beam of light exactly at 550 nanometers looks just as green as a mixture of yellow and blue, but to them the mixture may not look green at all. You’d need to have a completely different set of ratios to mix yer primary colors, to get your TV colors to look right for a dog. Reindeer apparently have a cone cell type that can see colors in UV that are invisible to us, but help them see predators (as snow-white wolves apparently don’t look snow white in UV).
What’s more, they may not have three types of cone cells – many animals have only two, and a handful have more than three – “tetrachromats” are animals with four types of cone cells, so for them there are four primary colors, not three. Some insects, for example, can also see down in the UV range, a fact not lost on flowers trying to attract them pollinating buggers. Flowers apparently look even more amazingly mind-blowing to insects, thanks to colors they can see and we can’t.
Alright, I’ve got something that EVERYONE has to admit is damn cool – some humans might be tetrachromats! The genes for two of the three cone cells are on the X chromosome, and because of this it’s theoretically possible that some women may have a fourth cone type. (Only women would have this superpower, as women have two copies of the X chromosome.) These superheroes may be walking among us now, in fact could be reading this article, over your shoulder RIGHT NOW LOOK BEHIND YOU! No, no… false alarm. But we must remain ever vigilant.
So what must life be like for these shadowy tetrachromettes? Well, not that different compared to us mortals – you might expect a psychedelic mélange of fantastic colors when you weren’t seeing through walls, but in reality you’d just be really really fantastic at discriminating between really close colors. With three cone cells, we can discriminate among about a million different shades of color, and theoretically with a fourth cone you could get up to about 100 million colors. Not bad, but subtle enough that any of us could conceivably be a tetrachromat and not notice.
A last word for the completists
Let’s get back to a question about primary colors that bugged me when I was a young lad, and probably bugs you too if you bothered to read this far. What’s the deal with red, blue, and green for TVs? Why not the familiar red, blue, and yellow? Everybody knows that green is mixture of yellow and blue, right? So why don’t they use yellow?
Turns out the primary colors we’re most familiar with are for mixing paints or pigments — stuff that *reflects* light. When you make red paint, you have to find some stuff that *absorbs* all wavelengths except the ones that look red. So its this funny double-negative thing. When you mix two pigments / paints together, you’re mixing two things that are designed to “absorb all but the color you want”. So figuring out what the resulting apparent color will be means sorting through what the two pigments both preferentially absorb and reflect. It’s what we’re most familiar with, dating back to glops of finger paint in kindergarten. But it’s actually more complicated than the other way you could mix color.
It’s a whole ‘nother ball game when you talk about things that shine with their own colored light, such as your TV — then you’re not mixing pigments that absorb stuff, now you’re directly mixing light of particular colors. Now the whole scenario of mixing changes — for example, when you mix a bunch of paints together, the color gets darker and browner, whereas if you mix a bunch of colored lights together, it gets whiter. This makes sense if you stop to think — mixing paint means mixing together more absorbers, so the resulting glop absorbs a lot more and should look darker. Mixing light means more light to be seen, so the resulting mix should look lighter.
So, when you mix together your three primary colors using colored lights (not pigments), you’ll actually get *white*, not brown or black. Even worse — the traditional mixing of colors that you know from childhood doesn’t work when you mix light sources. Mix red light and green light, and you get yellow, not brown. Mix blue and green and you get cyan, which is a light sky blue color. Turns out that green is a much more natural choice for a primary color in the arena of mixing light. You can try it — get some colored flashlights and shine them on a wall.
Sharp readers (e.g. anybody who bothers to read this far down) will now suddenly proclaim “AhAAA! You have been guilty of an error in your missive!” You’re absolutely right. Settle down. At the beginning of this essay I mentioned how I got to wondering why blue photons at 450 nanometers, mixed with yellow photons at 580 nanometers, looks to my eye to be the same color as green photons (which are at 55 nm). The horrid truth is, they don’t make green, they make white or gray – blue and yellow are complementary colors when we’re talking about light mixing together (additive color mixing) rather than pigments mixing (subtractive color mixing). The stunning truth is that the complementary color scheme we’re all familiar with (e.g. red is complementary to green) is completely different in the light-mixing world. Furthermore, the additive color mixing that goes on when you mix lights is really the more natural, simpler way to look at color. So we’ve been deceived all along…
Further Reading (because I can’t just keep typing)
If you made it this far, you’re enjoying the magical realm of color vision as much as I am. I could keep going, but I think society would agree that this blog post is long enough. Instead, here are some cool additional topics I haven’t gotten to here.
The Purkinje Effect: Turns out in dim light, color vision works a little different. You might’ve heard that you keep your “night vision” if you use only red lights. But why?
Mathematical Modeling of Hallucinations: Not that I have any personal experience (promise), but drug trips often lead to the same kinds of visual hallucinations. Turns out, the geometric patterns people see have to do with the organization of the visual cortex. And turns out, you can mathematically model that. This is, by far, my favorite application of math.