The Colors of the Rainbow

Copyright © Karl Dahlke, 2023

Throughout recorded history, and probably before then, humans have marvelled at the spectacular beauty of the rainbow in the sky. A bow appears sporadically, under just the right conditions of rain and sun, and when it does, the colors are dazzling. 🌈

People also wondered what caused the rainbow in the sky. An early guess was recorded in Genesis Chapter 9, after the great flood.

“I do set my bow in the cloud, and it shall be for a token of a covenant between me and the earth. And it shall come to pass, when I bring a cloud over the earth, that the bow shall be seen in the cloud: And I will remember my covenant, which is between me and you and every living creature of all flesh; and the waters shall no more become a flood to destroy all flesh.”

It's just a guess however, because, unlike Van Gogh, God did not sign his handywork. The colors float in the air, with no indication of a divine source. Well, most people would rather believe something, than to simply say, “I don't know.”

In fact we didn't know, for tens of thousands of years, until Isaac Newton performed his pivotal experiments in the 1690's. Yes, that Isaac Newton, the same man who developed physics from first principles, invented calculus, discerned universal gravity, calculated the orbits of the planets, and explained the tides. After he did all that, he stepped into optics, and created yet another branch of science.

His demonstration is conceptually simple. He cut a slit in a large sheet of cardboard, so that only a thin strip of sunlight entered his darkened room. This strip of light went into a block of glass, then exited through a beveled surface, where it projected onto a white wall. Here is a depiction of his experiment.

prism bending a ray of sunlight into colors

The beam travels in a straight line as it enters the prism head-on, but it bends as it exits from glass to air through a slanted surface. The slant makes all the difference. Furthermore, each color bends through a different angle. Red bends the least, then green, then blue, then violet. Since each color bends by a different amount, they project onto different locations on the wall. Red shows up at the top, and violet at the bottom. Newton had created the first artificial rainbow. His colors ran across the wall in straight lines, instead of arcs in the sky, but it was the same colors, in the same order.

don't assume there are 7 discrete bands of color in the rainbow. Whether in the sky or in Newton's darkened room, the rainbow consists of a continuous spread of colors, from red to red-orange to orange to orange-yellow, and so on to violet. It's more like a slide trombone than a piano. We assigned 7 colors to the rainbow primarily because we ascribe significance to the number 7. It is the number of days in a week, the number of notes in a musical scale, the number of holy sacraments, and so on. In fact, Newton established, in 1665, the 7 colors that we know today: red, orange, yellow, green, blue, indigo, violet. Prior to his addition of orange and indigo, there were only five.

Indeed, other cultures subdivide the rainbow in different ways. The Himba of Namibia have only five color words in their language: light, dark, red, yellow, and greenblue - thus their rainbow only has three colors.

Newton's next observation was nothing short of brilliant. He placed a second prism on top of the first, whence the sunlight went straight through, creating a white line on the wall, the same line that appeared if there were no glass prisms at all. Somehow the second prism put the colors back together into white light.

two prisms keeping light straight

Newton reasoned that it had to work this way, and he was right. Two prisms arranged in this manner become, essentially, one rectangular block of glass, like a thick window. People had been looking through windows for centuries, and hadn't noticed any rainbows. The second prism had to bend the colors back, reversing the effect of the first. Newton held the prisms apart just a hair, with barely the thickness of a piece of paper between them - and still the white light went straight through. Going from glass to air bent white light into its colors, but going from air back to glass put the colors back together and reproduced the white light. The first prism somehow "changed" white light into a spread of colors, he wasn't sure how, but by putting the colors back together, the second prism proved, conclusively, that white light is made of all these colors. White is not a separate color, as we had always thought. It was a composite. This was unsettling to many in the church, for white was the holiest color, the color of purity, the color of God himself. Consider the transfiguration in Matthew chapter 17.

“And after six days Jesus taketh Peter, James, and John his brother, and bringeth them up into an high mountain apart, And was transfigured before them: and his face did shine as the sun, and his raiment was white as the light. … And as they came down from the mountain, Jesus charged them, saying, Tell the vision to no man, until the Son of man be risen again from the dead.”

This was not the first time that science unsettled the religious community, and it would not be the last. Recall what happened to Galileo when he proved, with his telescope, that the earth was not the center of the solar system. Fortunately Newton was not persecuted to the same degree. People adjusted to white light comprising colors, faster than they adjusted to the idea that the earth, and humanity placed upon it, might not be the center of the universe.


The bending of light, as it passes from one medium to another across a slanted surface, is called refraction. This is from the Latin frāctus, meaning broken. Fracture, e.g. when a bone is broken, is a related word. The light beam is "broken", as it crosses from glass to air, or from air to glass, thus it travels on a different path.


Ok, but what causes the rainbow in the sky? There is no prism in the sky. But there is rain. Since water is denser than air, it can play the role of glass. Raindrops can act like little glass balls. These drops are round, and light enters and exits the drops at various angles. This is sufficient to split white light into its colors. Furthermore, the round drops produce circular arcs of colors, rather than the straight lines that Newton produced in his experiment. The precise geometry of a rainbow is quite complex, and beyond the scope of this book - however, Newton had explained the underlying mechanism, and anyone with a prism could reproduce it at home.


Genius or not, how did Newton ever think of this experiment? Prisms aren't just lying around, they have to be built. He had to ask a glass artisan to make a prism for him, to his specifications. This was easy, compared to the lenses of the day, with their convex curved surfaces. “A beveled rectangular block of glass - no problem!” But again, how did Newton ever come up with this idea?

It had been 80 years since Galileo's first telescope, and the craft had improved considerably. Large telescopes were revealing details never seen before, but a curious phenomenon was interfering with their optics. Small streaks of color sometimes appeared at the edges of planets and stars, as though the image were out of focus. Astronomers adjusted the lenses, their shapes, their separation in the tube, the composition of the glass, but to no avail. Newton wondered what caused these aberrations, and so, he designed the simplest possible experiment to explore this question. He made a lens that was not curved, it had flat surfaces, so that light could enter and exit at well-defined angles, under his precise control. We now call this "lens" a prism. Newton reduced sunlight to a single line, then passed it through his prism, so he could see exactly what happened to the light. He thought this would give him some information on the odd behavior of telescopes. It gave him that, and so much more.

What if he had not filtered sunlight through a single slit before passing it through his prism? Imagine two slits in the cardboard, one just above the other. That produces two rainbows, the second shifted up by a centimeter and placed on top of the first. Perhaps the orange band of the second is placed atop the red band of the first. If there are three slits, then three rainbows overlap, and the colors begin to merge. If the cardboard is removed completely, so that the light of day enters the room, a continuum of rainbows overlap, and they all blend together into white. It looks like the prism isn't doing anything at all. Newton had to reduce his experiment to a single slit of light, the simplest case, to see the effect.

With this understanding, lens telescopes seemed to run up against a physical limitation that they could not overcome. As they became larger, and more powerful, there was more blurring from the inconsistent refraction of colors. In a stroke of genius, Newton invented the reflecting telescope, which is based on mirrors, not lenses. Mirrors reflect all colors the same way. Red does not take a different path from blue. The entire image is in perfect focus, even for mirrors as large as a tennis court. All large telescopes now use this technology, including the Hubble space telescope, and the James Web space telescope.

Newton invented the reflecting telescope in 1668, before he fully understood the phenomenon of refraction and the mechanism of the rainbow. He knew there was a fundamental problem with lenses, and so, he took the next step.


the human eye, and the eye of every other mammal and bird, contains visual receptors, rods and cones, so named because they are shaped like rods and cones. Rods respond to light, any form of light. They are very sensitive, and particularly valuable for night vision. However, they don't provide any information on color. Takes some colored objects outside at night, without street lights or other illumination, and note that they appear as shades of gray. You are watching an old-time black & white movie. Even a full moon doesn't provide enough light for color.

In contrast, cones respond to color. They only focus on a small area, wherever you are looking, but the brain fills in the details and makes you believe your entire field of view is in color. This is based on the colors that you know and expect, or the colors you just saw as your eyes dart about the scene. The brain is a master at filling in details, especially the visual cortex.

Cones come in three sets: responding to red, green, and blue. Many people think red cones only respond to red light, but that is not the case. They respond almost as strongly to orange, since orange is next to red. They respond to green but only a little. They respond to blue but barely a trickle. The response is somewhat like a bell curve, with the strongest signal, the peak of the bell, at red. Similarly, the green cones respond primarily to green, and weakly to red and blue. The blue cones respond primarily to blue and weakly to other colors. The brain averages these signals out and determines the actual color.

As we now know, white light from the sun is a continuous blend of colors, from the deepest red to the brightest violet. The low energy colors activate the red cones, the middle colors activate the green cones, and the high energy colors activate the blue cones. (Red is at the top of the rainbow, but it is the color with the least energy.) When taken together, white light stimulates all the cones equally. The brain interprets all cones firing equally as white; we perceive it as white, a separate color. There is no single color that is white, but it sure feels like it in the brain.

It is possible to trick the brain into seeing white. Suppose you could generate just three colors of the rainbow, three razor thin lines: red, green, and blue. There is no orange, or yellow, or cyan, or mauve, just those three lines. All cones are stimulated equally, and your brain sees white. It can't tell the difference between this artificial setup and true sunlight. They both look white.

Similarly, suppose you generate pure red light and pure green light. This activates the red cones and the green cones equally. The same thing happens if you look at a yellow object. Yellow is midway between red and green, and produces the same response in your retina, and in the brain. You can't tell the difference between yellow, and red + green.

This trick was used to create color television in the 1950's. Each tiny patch of a tv screen contains phosphors that can glow red, green, or blue. Let's be practical - we can't build phosphors into a tv screen for every possible color. We have to keep the tv set affordable. If Marsha Brady is wearing a red dress, the red phosphors light up in the area of the screen that displays her dress. The green and blue phosphors are quiescent. If she is wearing a yellow dress, the red and green phosphors are activated. There are no yellow phosphors on the screen; we don't need them. This simple idea extends to every electronic device that is manufactured today.

Here is an experiment you can do at home. Find a computer or large screen tv, and bring up a picture with many colors. Turn down the brightness for safety, and place your eye up against the screen, so that you only see a tiny patch of realestate. Note the colored dots, red green and blue, that make up the color of the area you have zoomed in on. There are no orange dots, or yellow dots, or pink dots. All the colors your brain has ever seen are combinations of red, green, and blue, RGB for short. Thus these screens are called RGB displays.

In most computer languages, including html, the language of the internet, you can define a color by its RGB components. Sure, you can say that you want a patch of screen to be yellow, but if you want to be more precise, you can declare red = 250, green = 190, and blue = 0, which is somewhere between yellow and orange. White is 255,255,255, full saturation of all colors, and black is 0,0,0, no phosphors at all. As an exercise, what is gray?

That depends on whether you want dark gray or light gray. A middle gray is 100,100,100, somewhere between black and white.

How would you simulate pink? Like many colors, pink is not in the rainbow. It is not a pure color, not a pure tone on the electromagnetic spectrum. It is a combination of colors that an object might reflect, perhaps a flower, and it is a combination that we can simulate by RGB. You probably learned, in elementary school, that pink is an average of red and white. It is red diluted by white. So start with white, equal amounts of RGB, and turn down the blue and the green, so that red dominates. The internet standard for pink is 255,192,203. Mostly red, but still some green and blue. Other flavors of pink are: deep pink (255,20,147), light pink (255,182,193), and hot pink (255,105,180).

Other Animals

some say dogs can't see in color, but they can, to a limited degree. They have cones for yellow and cones for blue. In other words, they have a dichromatic vision system. Their color space has two dimensions, as light activates yellow and blue cones at various levels. If dogs invented color tv, it would have two color phosphers, yellow and blue - whence all the colors they could see would be generated by these phosphors. If dogs invented the internet, each color would be defined by two numbers, not three. What does red look like to a dog? Probably a dark yellow, as it weakly activates the yellow cones, and the blue cones not at all.

Indeed, most mammals have dichromatic vision, but primates, including humans, have three sets of cones. Apes and chimps and the like eat a lot of fruit, thus it is advantageous to know when that fruit is ripe. Distinguishing red from green is important. This could be the evolutionary basis for trichomatic vision in primates, and ultimately, in us. Cats and dogs don't eat fruit, so they don't care. For them, night vision, implemented by the rods, is more important.

Birds have bested us all when it comes to color vision. They have red green and blue cones, like us, but also ultraviolet cones, that see colors beyond violet. Newton had stripes on his wall, from red down to violet, but below violet was an area of ultraviolet, which he could not see. None of us can see it - but birds can, and some insects as well. This helps them see flowers from a great hight, flowers that might have nectar, flowers that present a beautiful color pattern in ultraviolet light. Also, some birds have feathers that reflect ultraviolet light. You thought a peacock's plumage was beautiful, and it is, but it may be even more colorful to another peacock.

If birds invented color tv, it would have four color phosphers, red green blue and ultraviolet - whence all the colors they could see would be generated by these phosphors. If birds invented the internet, each color would be defined by four numbers, not three. White would be an even saturation of all four colors: 255,255,255,255. Here is more on bird vision.

Seeing Ultraviolet

A few people can see ultraviolet, even though they don't have specific uv receptors like the birds. Our blue cones respond to ultraviolet light, though not as strongly as blue light. uv is at a higher frequency, beyond violet, but it is still within the bell curve of the blue cones. However, the lens of the human eye blocks most uv light, for our protection. Too much uv light will burn out the retina, just as it can cause a sunburn on the skin. uv light never gets to our retinas, and we don't get the opportunity to see it.

For medical reasons, such as cataracts, some people have had the lens removed, and replaced with an artificial lens. This synthetic lens transmits uv light, making it available to the retina, where it activates the blue cones and is perceived as a color. Is it just another shade of blue? Not necessarily. The uv light stimulates the blue cones, weakly, but is too energetic to stimulate the green or red cones. It is too far away on the electromagnetic spectrum. There is almost no spillover to the lower cones. In contrast, blue light weakly stimulates the green cones - there is a small amount of spillover. Therefore, the uv light generates a signal to the brain that is blue cones only, and no other color does that. The rest of us have never seen this light, and never received such a signal from our eyes. We haven't learned how to process it, or perceive it.

Bill Stark had this cataract operation at age 12, and now he can see uv light. When asked to describe it, he said it was a “desaturated (whitish) blue”. The same thing also happened to Claude Monet, which could explain why his palette became bluer in later life.

Other Light Sources

Suppose you had a prism, like Isaac Newton, and a shoebox to put it in, with a slit in one wall. Light travels through the slit and through the prism, and projects onto the other end of the shoebox. You can turn sunlight into a rainbow, as Newton did so long ago, but what about other light sources?

Use a traditional filament light bulb, if you can find one. The tungsten is hot, and liberates light simply by being hot, thus it is a smear of colors, like the son. However, it is not as hot as the sun. Reds and oranges and yellows are vivid bright, but blue and violet are not as bright, not as pronounced as the sun. Still, our brain understands that this is supppose to be white light, and we compensate, in a manner that is beyond the scope of this book.

A candle flame is also hot, though not as hot as the tungsten light bulb. There is almost no blue or violet. The spectrum is just a smear of red orange and yellow. Indeed, the flame looks orange to us, our visual system cannot deny the cooler temperatures.

A flurescent bulb, or an led bulb, produces specific wave lengths of light, a combination that tricks the brain into the illusion of white. You may see three thin lines, red green and blue, just like dots on a display screen. However, there are other combinations of colors that will activate our cones equally. The technology of the bulb determines the emissions that are easiest to produce, while still giving the illusion of white.