Did you know that the entire spectrum of visible light can be broken down into seven distinct colors? And each of these colors corresponds to a specific wavelength, which has been standardized and assigned a code. This is what's known as a rainbow color code. Let's delve into this fascinating world of color science.

But first, let's understand how light is perceived as color. It all began in 1672 when Sir Isaac Newton passed white light through a prism, splitting it into seven colors: red, orange, yellow, green, blue, indigo, and violet. These seven colors became known as the 'Newton's prismatic spectrum' or simply, the visible light spectrum.

Understanding Color Codes
The color codes we use today initially emerged from the need to standardize color in the printing and digital domains. But the physics behind color codes owe their origins to Sir Isaac Newton's experiments.

However, Newton's jednej series of colors (known as the Newton's Seven) was later replaced by the modern 'rainbow series' of six colors (adding a seventh color, violet, into Newton's first two colors, indigo and violet), as we know them today.
Additive Color Model

The lighting system in our digital devices, such as computer screens or smartphones, uses red, green, and blue (RGB) to create all the colors we see. This is known as the additive color model. You might wonder, why not seven colors? The seventh color, violet, is a product of light with a very short wavelength, which is difficult to reproduce digitally.
In this model, the RGB color code works as follows: each color is assigned a value between 0 and 255, with 0 being absence of color (full absence giving black) and 255 being the vibrant color itself (full presence). For instance, pure red is RGB(255, 0, 0), while pure green is RGB(0, 255, 0).
Subtractive Color Model

In contrast, the color system used in physical color, like paints or dyes, is the subtractive model. Here, instead of adding light to create color, we subtract light to create it. This model is based on the three primary colors: cyan, magenta, and yellow (CMY).
In this model, color is represented by a percentage of each color present in an ink or dye. For example, 100% cyan, 100% magenta, and 100% yellow would make black, as they absorb all visible light. This is why your favorite printer's toners are CMYK instead of CMY. The 'K' stands for black, added to keep the subtractions simpler.
Exploring Rainbow Colors & Their Codes

Though the rainbow colors have been part of human imagination for centuries, the standardization of these colors, and their respective codes, came much later with the advent of science and technology.
Starting from the left of the rainbow spectrum, the colors and their RGB codes are as follows:

















- Red: RGB(255, 0, 0)
- Orange: RGB(255, 165, 0)
- Yellow: RGB(255, 255, 0)
- Green: RGB(0, 255, 0)
- Blue: RGB(0, 0, 255)
- Indigo: RGB(75, 0, 130)
- Violet: RGB(238, 130, 238)
This code set is widely used in the fields of design, graphics, and technology to represent and manipulate colors digitally. However, the possibilities of light and color go beyond the standard seven colors, offering an infinite spectrum of hues and shades.
Understanding the rainbow color code not only helps in creating heroes and villains in our favorite superhero movies but also helps in recreating the beauty of a sunrise in digital photography. So, the next time you marvel at a sunset, you'll understand that the dance of colors is more than just pretty - it's physics in play.