while sunlight is white, all white light is actually a blend of many different colours. water and other materials bend the different colours at different angles, some more strongly than others. this is called dispersion. by splitting up white light into its separate colours, rainbows appear colourful even though the source of light hitting them is white.