So far, we have only discussed interference patterns produced by monochromatic light. Things become a lot more colorful if we use a beam of white light instead.
Remember that white light contains light of all colours in the visible spectrum. In other words, white light consists of light waves of wavelength between 400 nm to 700 nm. Since coherence is required for interference, each wavelength (colour) can only interfere with itself. So an interference pattern is produced for each colour. The resultant interference pattern is simply all the different coloured interference patterns overlaid on one another.
For example, when white light passes through a double-slit, colourful fringes are formed as shown below. (For reference, the interference pattern for monochromatic green light () is shown in the top row)
The key to understanding the pattern is to remember that the fringes formed by monochromatic red light () are broader and more spaced out, and those formed by monochromatic violet light () are narrower and closer together.
This explains why the central white fringe has a reddish tint at the edge. This is because even though the 0th order bright fringe of every colour is centred at the middle, red with the longest wavelength has the widest fringe.
On either side of the central white fringe, we see even more colourful fringes. For higher order fringes, the positions of bright fringes are dependent on the wavelength. For each order, the violet fringe is formed nearest the centre, the red fringe furthest away, and the other colours in between. So instead of recombining back into white light, they combine to form coloured light (The resultant colour depends on the intensity of each colour at that position).
We know that if we have more slits, we can obtain narrower bright fringes. If each colour forms very thin fringes, there will be less overlapping and the different colours will be more separated. Shown below is the pattern formed by passing white light through a 15-slit grating.
Here, we see a narrow white line at the middle, formed by the recombination of the (very narrow) 0th order bright fringes of every colour. On either side, we see a distinct 1st order spectrum, formed by the 1st order bright fringes of all the colours, beginning with violet, ending with red. Even further out, we have the 2nd order spectrum, where the colours are even more separated. Notice also that the violet end of the 3rd order spectrum actually starts before the red end of the 2nd order spectrum, resulting in overlapping spectrums.
So you see, beside refraction, interference can also cause the separation of colours. To many people, when they see rainbows around them, they assume that refraction is involved. Actually, nature has in store for us many natural gratings, producing rainbows everywhere.