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 Chinese mythology, the rainbow was a slit in the sky sealed by Goddess Nüwa using stones of five different colours. In Hindu mythology, the rainbow is called "Indradhanush", meaning the bow (Sanskrit & Hindi: dhanush is bow) of Indra, the God of lightning, thunder and rain. Another Indian mythology says rainbow is the bow of Kama, the God of love. It is called Kamanabillu in Kannada, billu meaning bow. 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.
After Noah's Flood, the Bible relates that the rainbow gained meaning as the sign of God's promise that terrestrial life would never again be destroyed by flood (Genesis 9.13-15)[25]:
I have set my bow in the clouds, and it shall be a sign of the covenant between me and the earth. When I bring clouds over the earth and the bow is seen in the clouds, I will remember my covenant that is between me and you and every living creature of all flesh; and the waters shall never again become a flood to destroy all flesh.
Another ancient portrayal of the rainbow is given in the Epic of Gilgamesh: the rainbow is the "jewelled 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. (The Epic of Gilgamesh, Tablet Eleven)
Then Ishtar arrived. She lifted up the necklace of great jewels that her father, Anu, had created to please her and said, "Heavenly gods, as surely as this jewelled necklace hangs upon my neck, I will never forget these days of the great flood. Let all of the gods except Enlil come to the offering. Enlil may not come, for without reason he brought forth the flood that destroyed my people."
In the Dreamtime of Australian Aboriginal mythology, the rainbow snake is the deity governing water.
In New Age and Hindu philosophy, the seven colours of the rainbow represent the seven chakras, from the first chakra (red) to the seventh chakra (violet).