All the 'Roygbiv'(red, orange, yellow, green, blue, indigo, violet) mnemonics follow the tradition of including the colour indigo between blue and violet.
Newton originally (1672) named only five primary colours: red, yellow, green, blue and violet. Only later did he introduce orange and indigo, giving seven colours by analogy to the number of notes in a musical scale.
Some sources now omit indigo, because it is a tertiary color and partly due to the poor ability of humans to distinguish colours in the blue portion of the visual spectrum.
Since rainbows are composed of a nearly continuous spectrum, different people, most notably across different cultures, identify different numbers of colours in rainbows.
The rainbow has a place in legend owing to its beauty and the historical difficulty in explaining the phenomenon.
In Greek mythology, the rainbow was considered to be a path made by a messenger (Iris) between Earth and Heaven.
In Hindu mythology, the rainbow is called Indradhanush, meaning the bow of Indra, the God of lightning and thunder.
In Norse Mythology, a rainbow called the Bifröst Bridge connects the realms of Ásgard and Midgard, homes of the gods and humans, respectively.
The Irish leprechaun's secret hiding place for his pot of gold is usually said to be at the end of the rainbow. This place is impossible to reach, because the rainbow is an optical effect which depends on the location of the viewer. When walking towards the end of a rainbow, it will move further away.
In the Biblical canon of Christian and Jewish scripture, the rainbow is explicitly stated as a sign of the Noahic Covenant between God and The Creation, and the biblical God's promise to Noah that never again would The World be purified by the deluge.
Another ancient and accurate portrayal of the rainbow is given in the Epic of Gilgamesh: the rainbow is the literal “jeweled necklace of the Great Mother Ishtar” that she lifts into the sky as a promise that she “will never forget these days of the great flood” that destroyed her children. This is an accurate portrayal, as each life-giving droplet of rain could be interpreted as a precious diamond, and when sunlight is refracted through each of these millions of “diamond” prisms, a rainbow is formed.
In Chinese mythology, the rainbow was a slit in the sky sealed by Goddess Nüwa using stones of five different colours.