We, and many other animals, have colour vision, and so we are surrounded by our uses of colour, from football shirts to different colour iPods. The dyes used to make a football shirt red, for example, are just chemical substances that adsorb blue and green photons but reflect red photons. Then of the white light from the sun, the blue and green parts are adsorbed with only the red part reflected into our eyes, so we see red. But that there is another way to make colours.
This is to not adsorb light but to bend it. We all know that the light bends when it enters the water of say a swimming pool. If red light can be bent differently from blue and green, this can also make coloured objects. One way to do this very strongly with light is to have a repeating structure in a material where the length of the repeat is comparable to that of light.
Here the colour is controlled less by chemistry, more by geometry, although as the geometry is on a size scale that is the wavelength of light, this is not visible to the human eye. The wavelength of light is around one half of a thousandth of a millimetre – a bit larger for red light and a bit smaller for blue.
So, then to produce beautiful colours we need to control the geometry, on this tiny size scale. This brings me to oil and water. Oil and water famously do not mix and so you end up with a layer of oil on top of layer of water (if the oil is of the sort that is lighter than water). However, you can force them to mix with some combination of shaking, temperature and surfactant (the stuff in washing-up liquid that dissolves the oily stuff from food in the washing-up water).
If you then start with oil and water mixed then as they separate you start out with tiny droplets of oil – much less than the wavelength of light – and these grow and grow until you get a thick oil layer on top of the water. But in this progression at one point the droplets are around the wavelength of blue light (then a little later the wavelength of green light …).
If the growth of the droplets is arrested when they are the right size then the geometry needed to bend light of different colours differently is obtained. Now oil droplets just keep growing but Prum et al. suggest that nature has cracked the problem of getting droplets not of oil but of the protein keratin to grow to just the right size. Keratins are the proteins that make up our hair and nails and birds’ feathers.
The result is shown at the top left – the bright blue and yellow feathers of the macaw are coloured by geometry (on the scale of the wavelength of light). Prum and coworkers use electron microscopy to see the microscopic patterns that produce the brilliant colours seen in birds (and butterflies, and some other animals). There is a lot going on as the structures are made but it is interesting that part of it may be simple control over a simple separation process. Also the colours produced are just beautiful.
http://www.flickr.com/photos/rabinal/5246981288/
Interesting question on your Flickr page. If the different colours are indeed produced by nanostructures of different lengthscales then if this lengthscale varies continuously down the neck of the bird it might produce a rainbow type effect with the colours in the same order as in the rainbow. So, maybe but I am not an expert.