Primary Colours
The visible spectrum is one-dimensional, spanning a range of wavelengths from approximately 400 nm (violet) to 700 nm (red). However, human color vision is trichromatic, meaning it relies on three types of photoreceptor cells in the retina, called cones, which are sensitive to different parts of the spectrum in well-lit conditions. These cones are:
- L-cones (Long wavelength): Most sensitive to low-frequency, reddish light.
- M-cones (Medium wavelength): Most sensitive to medium-frequency, greenish light.
- S-cones (Short wavelength): Most sensitive to high-frequency, bluish light.
The brain processes the signals from these three cone types to perceive color, allowing us to distinguish millions of colors through additive mixing. This trichromatic nature underpins why we use Red, Green, and Blue (RGB) as the primary colors for additive color mixing (e.g., in screens and digital displays). In contrast, the Red, Yellow, and Blue (RYB) model is used in subtractive color mixing (e.g., with pigments or paints). In this model, colors are perceived based on which wavelengths are absorbed versus reflected. Each pigment absorbs light at specific wavelengths:
- Red absorbs short wavelengths (blue/violet).
- Yellow absorbs medium wavelengths (green).
- Blue absorbs long wavelengths (red).
While RYB works for traditional artistic color mixing, modern color science often uses Cyan, Magenta, and Yellow (CMY) as the subtractive primaries due to their more precise alignment with the physics of light absorption and reflection.
Some humans have an additional color sensor in the mid-range (tetrachromatic), enabling them to perceive yellows and greens with much greater distinction. In contrast, dogs are dichromatic and lack the ability to sense colors in the yellow/green wavelengths, limiting their color vision.
Mantis shrimps, however, are extraordinary in this regard, possessing 16 different types of photoreceptors. This gives them:
- A more vivid color palette: With more photoreceptors in the visible spectrum, they can differentiate hues that are indistinguishable to humans.
- A broader range of visible colors: They can see into parts of the infrared (IR) and ultraviolet (UV) spectrum that are invisible to humans.
- Light polarization sensitivity: This unique ability adds an extra “dimension” to their vision, allowing them to detect the orientation and filtering of light waves.
Wetware in the brain mstill means that we get a richer colour ramp using a palette of Red, orange,yellow,green,blue,indego and violet compared to one of only red, green and blue
While it’s true that the three primary colors—red, green, and blue (RGB)—can theoretically stimulate all three types of photoreceptors (cones) in the human eye, the reason a ROYGBIV ramp (red, orange, yellow, green, blue, indigo, violet) looks richer and more nuanced than an RGB ramp lies in the nature of how colors are mixed, perceived, and displayed. Here’s why:
- Human Perception of Color and Gradients Human color perception isn’t just about stimulating cones (L, M, S for long, medium, and short wavelengths corresponding to red, green, and blue). Our perception of color is highly influenced by the relative proportions of stimulation from all three cones and how the brain interprets those signals. A color ramp using ROYGBIV has smoother transitions between colors, mimicking the natural spectrum of light seen in a rainbow. These transitions align more closely with how our visual system processes continuous changes in wavelength. On the other hand, when mixing just red, green, and blue, there are fewer intermediate colors, and the transitions between hues can appear more abrupt, leading to a less “rich” gradient.
- Spectral Colors vs. Additive RGB Colors ROYGBIV represents spectral colors, which are pure wavelengths of light in the visible spectrum (e.g., red at ~700 nm, violet at ~400 nm). These colors stimulate our cones in a way that feels natural because they correspond to how light behaves physically. RGB, on the other hand, is an additive color model used in digital displays. It creates colors by mixing light from red, green, and blue channels, but it does so using discrete values and does not replicate the smooth transitions of a spectrum. Many colors in the spectrum (e.g., cyan, yellow) are approximated by blends of RGB primaries, which are not pure spectral colors.
- Intermediate Colors and Cone Response Intermediate colors like orange, yellow, and cyan (found in ROYGBIV) are blends of light wavelengths that stimulate cones in a way that is closer to natural perception. For example: Yellow stimulates both the red (L) and green (M) cones strongly, creating a distinct perceptual response that feels different from simply blending red and green in RGB. Similarly, orange provides a softer transition from red to yellow, which feels more intuitive and natural. With just red, green, and blue, it’s harder to hit the exact combinations of cone stimulation that mimic intermediate colors like yellow, orange, and cyan because these colors have to be created by approximation in RGB.
- Color Models and Gamut The RGB model has a limited gamut (range of colors it can produce) compared to the full spectrum of colors perceivable by the human eye. Even though RGB can create many colors by mixing, it cannot perfectly replicate spectral colors like pure yellow or violet. The ROYGBIV ramp inherently uses more points in the visible spectrum, so it better approximates the way light naturally stimulates our cones across the rainbow.
- Psychological Effects of Gradients A smooth ROYGBIV ramp is more visually satisfying because it replicates what we see in natural phenomena like rainbows or sunlight passing through a prism. This aligns with the expectations of our visual system, making it feel richer. In contrast, an RGB ramp can feel more artificial because it moves between three extremes (red, green, and blue) without accounting for the intermediate hues our eyes expect.
- Implementation in R When creating a color ramp in R, the function you use (e.g., colorRampPalette()) interpolates between the colors you provide. If you supply only red, green, and blue, the interpolation will move linearly between these three points in RGB space, skipping intermediate hues like orange or cyan. By including ROYGBIV, you’re explicitly telling R to include more “stopping points” in the gradient, which ensures that the ramp passes through intermediate colors. This makes the gradient smoother and feels more natural to our eyes.
- Why Not Just RGB? While RGB stimulates all three cones, it doesn’t account for how humans interpret blends of color. The color-processing centers in our brains expect natural transitions between colors based on their physical wavelengths. A gradient built only from red, green, and blue doesn’t provide enough resolution or intermediate steps to match that natural perception. The ROYGBIV palette bridges this gap by incorporating colors that approximate these intermediate steps, even if they aren’t perfect spectral colors.