I learned a lot but didn’t write all of it up, so this page is incomplete.

Imagine a world in which everyone but you is color blind. You notice people wearing mismatched clothes. They use the same name for different colors. It’d be a bit weird. It turns out everyone really is color blind, but since everyone else is too, nobody notices. There’s a whole lot I could say about this but in this post I want to focus on the color yellow.

The eyes has “red”, “green”, and “blue” cones, and our screens and cameras have red, green, and blue as well. That’s three primary colors of light. But ask any kid — there are four primary colors: red, yellow, green, blue. Or look at the original 8 Crayola colors[1]: red, yellow, brown, orange, green, blue, violet, black. Of these, there are three colors in the red—green range, and none in the green—blue range. Why the discrepancy?

It’s not just kids’ colors. This diagram[2] shows some color names used by artists. Here too there are a lot more colors in the red—green range than in the green—blue range. And it’s not just English. Across many languages, red, yellow, green, blue are the first four colors, and these colors show up in opponent process theory[3].

The short answer is that there are cells in the eye that combine the raw signals into a different set of signals for color perception. However, I wanted to see whether the raw signals from the eye by themselves can explain why we have more color names in the red—green range than in the green—blue range, without using the color perception signals.

This is the wavelength response for the three types of cones. The three curves are called luminosity curves. I plotted the data I downloaded from here[4]; it seems to match the chart on wikipedia[5]:

Any light coming in at a wavelength detected by one of the sensors will activate that receptor. For example, a red wavelength like 650nm will activate the red receptor (L) a lot, the green receptor (M) a little, and the blue receptor (S) not at all. If a receptor is only slightly sensitive to some frequency, it will only activate weakly. An infrared light wave will activate the red receptor weakly, and it will look to us like dark red.

We’re used to writing colors with RGB values, but there are many ways of writing colors (HSL, HSV, CIE, Lab, etc.). If we use the receptor values we’re using the LMS color space[6].

One oddity to notice is that there’s no way to trigger green (M) without also triggering red (L). The high overlap between green and red is what I believe will explain why have more color names there. When these curves overlap little, such as with S, a dim light at S’s peak wavelength will look just like a bright light at S’s non-peak wavelength. Furthermore the wavelengths higher than the peak and lower than the peak produce very similar signals (“principle of univariance”). When the curves overlap a lot, such as with L and M, a wavelength higher than M’s peak will produce a larger L and smaller M, whereas a wavelength lower than M’s peak will produce a smaller L and a smaller M. We get a different combination of signals by going up or down from the peak wavelength.

There are other asymmetries. The S cones are evenly distributed, except they’re not in the very center of vision. The L and M cones occur in clumps. There are fewer rods near the center of vision.

The raw signals received by the brain are combined into these signals:

This resolves the mismatch between Helmholtz’s three primary color theory (red, green, blue, which we see in eyes, cameras, screens) and Hering’s four primary color theory (red, yellow, green, blue, which we see in common color names, board games, logos, etc.).

To test the formulas I found on wikipedia, I generated a spectrum image:

For each wavelength, I transform it to L, M, S values, then convert LMS to the CIE XYZ color space, then convert XYZ to RGB. For testing purposes I also compared this to wavelength→XYZ→RGB and wavelength→RGB. When I used LMS I was unable to produce violet, but when I converted wavelength→XYZ or wavelength→RGB I got violet.

Other than violet, this image matches the reference spectrum I found elsewhere, so I proceeded with my calculations.

My hypothesis was that the changes in L,M,S values should correspond to the change in perceived color. In particular, it should change a lot in the yellow-orange region because of the overlap of the L and M curves, and very little in the blue region, where the S curve has low overlap with the others. I normalized L,M,S and then plotted how much L,M,S changed every time I changed the wavelength by 1, and compared that to the reference image on Wikipedia[8]:

As I had hoped, it is higher in the yellow-orange, but it is even higher in the cyan region (not what I expected). In the blue and red zones there’s not much change in L,M,S across wavelengths.

Here’s the change in Lab space color at each wavelength. Since distances in Lab color is supposed to correspond to perceptual differences, this chart shows how much the change in wavelength affects the perceived color:

It has some similarities to the LMS chart but generally does not match. A noticeable difference is that it shows the transition from blue to violet is perceivable, whereas my LMS calculations don’t show violet at all.

The colors we see are the light source multiplied by the reflected color multiplied by the eye’s cones.

Most colors will activate more than one receptor. For example, orange light will activate the red and green receptors. When we see “orange” it’s because our brain interprets simultaneous red and green as orange. When we see “yellow” it’s also because of simultaneous red and green, but in a different ratio.

More than one frequency can come in at the same time. If both a red and green frequency come in at the same time, they will activate both the red and green receptors, which will make the light look “orange”. However, the light waves may contain no orange frequencies. This is what I mean when I say that we are all color blind. We can’t distinguish orange light from a mixture of red and green.

Static diagram, two dimensions: frequency on x-axis and frequency on y-axis. Calculate the image by multiplying. Option: adjust position of green, red, blue left/right to see effect of red-green colorblindness, different kinds of colorblindness, tetrachromats

Animal kingdom has four types of cones, roughly detecting infrared, brown, blue, and ultraviolet; see the diagram on the bird vision page of wikipedia[9]. Mammals have the brown and blue cones. Primates have the brown split into green and red (around 30-40 million years ago); see wikipedia[10]. The L and M cone genes are similar and sometimes merge during meiosis, producing red-green color-blindness. Women experience red-green color blindness far less than men because the L and M genes are on the X chromosome, and if they merge on one X chromosome, women have a second X chromosome where they may not have merged. Human “tetrachromats” have an additional brown cone, similar to M and L. It should increase color sensitivity a little bit but my guess is that it’s nowhere near as useful as a second blue cone would’ve been.

The cone cells have both spatial and temporal effects. The temporal effects can be experienced when you stare at a color picture for 30 seconds and then see an afterimage[11] when you look away.

The red cone can pick up some infrared, and if you block out all other wavelengths you can see near infrared[12]. Another trick with blocking out wavelengths is to block out the wavelengths where L and M cones overlap. Watch Ethan see purple for the first time[13]. This suggests that many red-green colorblind people actually have both L and M cones, but they’re overlapping too much for the brain to pick up the L-M signal. The glasses essentially “increase contrast” for the L-M red-green signal to the point where many red-green colorblind people can distinguish red from green!

The all three cones can pick up a little bit of ultraviolet, but most of the ultraviolet is blocked by the lens of the eye. The S cone picks up ultraviolet slightly more than L or M. As a result, ultraviolet-reflecting objects (such as t-shirts or shoelaces) can look like a bluish white.

The color you see is the sum over all wavelengths of { the product of the light source’s wavelength multiplied by the object’s color at that wavelength }. As a result, the same object can look different colors under different lights. The brain tries hard to autocorrect for this but cameras have to be told which “white balance” to use. My red car looks gray under single-frequency yellow streetlights.

The CIE XYZ diagram shows how X and Y are related, and how many combinations of X,Y,Z can’t even be seen by humans. The magentas don’t correspond to any wavelength of light.

CIE XYZ space gave us comparisons between colors (brighter/darker, more/less saturated, redder/bluer) but not distances. CIE LUV and CIE Lab give distances too. Euclidean distance in CIE Lab color space is a reasonable approximation of perceptual difference but they later came up with better approximations of distance that make Lab no longer the ideal space. https://en.wikipedia.org/wiki/Color_difference#CIE76[18]