rainbow colors

EnglishFrançaisEspañolDeutschItalianoPortuguês

Give me colors

Tap a color to copy its code
Size

Press F or Esc to leave full screen

The colors of the rainbow in order: ROYGBIV

From the outside of the arc to the inside, a rainbow runs red, orange, yellow, green, blue, indigo and violet. The initials spell ROYGBIV, and generations of British pupils learned the same order with “Richard Of York Gave Battle In Vain”. The tool above gives you the seven colors as a palette, always in that order, with a slightly different shade of each one every time you press Generate. Tap a band to copy its HEX code, or choose 3 to 6 colors to keep only part of the arc.

Why the order never changes

A rainbow is sunlight split by raindrops. Each drop bends the light as it enters, reflects it off its back and bends it again on the way out, and every wavelength bends by a slightly different amount. Red, the longest wave our eyes can see, at around 700 nanometers according to NASA, comes out at the widest angle, so it forms the outer band. Violet, the shortest at around 380 nanometers, forms the inner band. That is also why you only see a rainbow with the sun behind you. When a fainter second bow appears above the first, its colors are reversed, with red on the inside.

Seven colors, or six?

The spectrum is a smooth blend, so any count is a choice. Isaac Newton settled on seven, partly to echo the seven notes of a musical scale, and indigo has been argued about ever since: many people only see a deeper blue between blue and violet. The table below gives each color the typical shade our generator aims for, with its codes and how readable white text is on it. For the full circle of hues, see the color wheel; for each color’s opposite, the complementary colors.

The 7 colors of the rainbow, in order

The 7 colors are listed from the outer edge of the arc to the inner edge, which is also the order of the spectrum, from the longest light waves to the shortest. Each row gives the typical color the generator aims for (the middle of its range), its codes and its contrast with white and black text: 4 of the 7 keep white text readable (4.5 or more, the WCAG threshold for body text).

red #E81115orange #F98015yellow #FAE11Egreen #25A72Bblue #0E72DDindigo #2B208Dviolet #9B3DD6
The seven bands in sky order: red on the outer edge, violet on the inner edge.
#ColorHEXRGB and HSLContrast white / blackReadable text
1red#E81115rgb(232, 17, 21)
hsl(359, 86 %, 49 %)
4.6 / 4.5white
2orange#F98015rgb(249, 128, 21)
hsl(28, 95 %, 53 %)
2.6 / 8.1black
3yellow#FAE11Ergb(250, 225, 30)
hsl(53, 96 %, 55 %)
1.3 / 15.9black
4green#25A72Brgb(37, 167, 43)
hsl(123, 64 %, 40 %)
3.2 / 6.6black
5blue#0E72DDrgb(14, 114, 221)
hsl(211, 88 %, 46 %)
4.7 / 4.5white
6indigo#2B208Drgb(43, 32, 141)
hsl(246, 63 %, 34 %)
12.4 / 1.7white
7violet#9B3DD6rgb(155, 61, 214)
hsl(277, 65 %, 54 %)
5.2 / 4.0white

Six sample palettes

Drawn once for this page with the same rule as the tool, so you can see the kind of palettes it makes before you generate your own.

#Colors
1#DA1916 #F4831F #FEE71B #26BA3A #1080D1 #322790 #A242D1
2#ED140C #F78922 #FEE71B #2EA334 #0664E0 #2A1E94 #8C25DA
3#E51C15 #FD8421 #F6E828 #2D9C21 #1464E6 #34249E #993BD8
4#E5101E #F4852A #F9D315 #279037 #085FE2 #2E298E #9B2ED1
5#EB0F13 #FF871F #F7E51D #2F9424 #1775D9 #27239F #AB4BD8
6#E01522 #FB8618 #FFF024 #24942F #0F6BEB #242178 #8C33CC

Rainbow colors: how it works

  1. Pick the number of colors

    Tap the number in the sentence to get 3, 4, 5 or 6 colors, and the theme to switch between random, pastel, Christmas, autumn, earth-tone and neon.

  2. Generate a palette

    Press Generate or the space bar. The colors slide in and the whole page takes the first one, so you see the palette at full size.

  3. Copy the codes

    Tap one color to copy its HEX code, or Copy all to get the whole palette, ready to paste into your design tool, your CSS or a message.

Any suggestions for improvement?

We build tools that are as simple and intuitive as possible, with a few bonuses here and there. Tell us what would make this one better.

Rainbow colors: frequently asked questions

What are the 7 colors of the rainbow in order?

Red, orange, yellow, green, blue, indigo and violet, from the outer edge of the arc to the inner edge. The initials ROYGBIV make the order easy to remember.

Why is red always on the outside of a rainbow?

Red light has the longest wavelength we can see and leaves each raindrop at a slightly wider angle than the other colors, so it lands on the outer band. Violet bends the most and lands on the inside.

Is indigo really a color of the rainbow?

It is one of the seven colors Newton named, but it is a narrow band between blue and violet and many people cannot pick it out. Some schools now teach a six-color rainbow without it.

What are the HEX codes of the rainbow colors?

There is no single official set. The table on this page lists the typical shade the generator uses for each band, for example #E81115 for red and #0E72DD for blue, and the tool draws a fresh shade of each one on every press.

Is the random color generator free?

Yes. It is free to use, funded by advertising, with no account and no app to install.