Rainbow colors in order
Red, orange, yellow, green, blue, indigo, violet, with hex codes and contrast.
The seven colors in order
The rainbow colors in order are red, orange, yellow, green, blue, indigo and violet, from the outside of the arc to the inside. The initials make the name ROY G. BIV, a common mnemonic for the sequence.
Screen approximations of each band. Contrast ratios are WCAG relative-luminance ratios.
| Color | Hex | RGB | Contrast on white | Contrast on black |
|---|---|---|---|---|
| Red | #FF0000 | 255, 0, 0 | 4.0:1 | 5.3:1 |
| Orange | #FF7F00 | 255, 127, 0 | 2.5:1 | 8.3:1 |
| Yellow | #FFFF00 | 255, 255, 0 | 1.1:1 | 19.6:1 |
| Green | #00FF00 | 0, 255, 0 | 1.4:1 | 15.3:1 |
| Blue | #0000FF | 0, 0, 255 | 8.6:1 | 2.4:1 |
| Indigo | #4B0082 | 75, 0, 130 | 13.0:1 | 1.6:1 |
| Violet | #8F00FF | 143, 0, 255 | 5.8:1 | 3.6:1 |
These hex values are approximations. A real rainbow is a continuous spectrum, and its purest colors fall outside what a standard sRGB screen can show, so every digital rainbow is a stand-in. The table also shows why rainbow text is hard to read: yellow and green on a white background fall well short of the 4.5:1 that WCAG asks for normal text, and blue and indigo on black do the same. See the contrast checker to test your own pairs.
Why seven colors?
The number is a choice, not a physical fact. Isaac Newton first described five main colors in 1672, then added orange and indigo to reach seven, by analogy with the seven notes of a musical scale. The spectrum itself has no hard edges. Many modern descriptions use cyan in place of indigo, giving red, orange, yellow, green, cyan, blue and violet.
How a rainbow forms
A rainbow appears when sunlight is refracted as it enters a raindrop, reflected off the back of the drop, and refracted again as it leaves. Different wavelengths bend by slightly different amounts, so the light spreads into colors. In a primary rainbow the arc shows red on the outer edge and violet on the inner edge.
Why a double rainbow is reversed
In a double rainbow, a second, fainter arc appears about 10° outside the primary one, and its colors are in reverse order: red is on the lower, inner side and violet on the outer side. The second arc comes from light that reflects twice inside each drop.
Using rainbow colors in design
A full-saturation rainbow is loud, so it works for short moments such as a logo mark, a progress meter or a pride flag, and badly for long text or data charts. For a calmer version, take the same hues at lower saturation, or use the evenly spaced hues of the color wheel as a base for a palette. The twelve-step tertiary sequence fills in the gaps between the seven bands.
Frequently asked questions
What are the rainbow colors in order?
Red, orange, yellow, green, blue, indigo and violet, from the outer edge of the arc to the inner edge. The mnemonic is ROY G. BIV.
Why does a rainbow have seven colors?
Seven is a convention. Isaac Newton settled on seven by analogy with the seven notes of a musical scale. The real spectrum is continuous, so the number of named bands is a choice.
Is indigo a real rainbow color?
It is part of Newton's traditional seven, but many modern descriptions use cyan in its place.
Why is the second rainbow reversed?
The fainter outer arc in a double rainbow comes from light reflecting twice inside each raindrop, which flips the order, so red is on the lower side and violet on the upper side.
Content updated