Nature

Why does a rainbow have colors?

The short answer

A rainbow appears when white sunlight is bent, reflected, and separated into colors inside raindrops. White light is a mixture of many colors of light.

What happens inside a raindrop

When light enters water from air, its direction changes. This is called refraction. Light reflects inside the drop, and the different colors do not bend by exactly the same amount as they leave. The colors therefore spread out.

Light from many raindrops reaches your eyes from particular angles, forming a large arc. When you move, the drops sending light to your eyes change too.

A common misunderstanding

A rainbow is not painted onto the sky. It is easiest to see when the Sun is behind you and rain or spray is in front of you. A rainbow after a shower and one near a fountain come from the same kind of geometry.

One more idea

Red usually appears on the outside and violet on the inside because each color leaves the drops in a slightly different direction. Under the right conditions, a second rainbow can appear outside the first one.

Sources