Red, orange, yellow, green, blue, indigo blue, and purple are the colours of the rainbow, and they always appear in this sequence, except from double rainbows, in which the sequence is inverted.
In 1669, physicist Isaac Newton (16421727) explained how white sunlight could produce colours. He directed light through a glass prism and watched, as it was refracted into a colour spectrum. White light contains all colours, and you can split it up, like when it is refracted in a prism or produces a rainbow. The sequence is due to light being refracted differently – purple light is refracted the most, red the least.