Animal coloration is the general appearance of an animal resulting from the reflection or emission of light from its surfaces. Some animals are brightly coloured, while others are hard to see. In some species, such as the peafowl, the male has strong patterns, conspicuous colours and is iridescent, while the female is far less visible.
There are several separate reasons why animals have evolved colours. Camouflage enables an animal to remain hidden from view. Animals use colour to advertise services such as cleaning to animals of other species; to signal their sexual status to other members of the same species; and in mimicry, taking advantage of the warning coloration of another species. Some animals use flashes of colour to divert attacks by startling predators. Zebras may possibly use motion dazzle, confusing a predator's attack by moving a bold pattern rapidly. Some animals are coloured for physical protection, with pigments in the skin to protect against sunburn, while some frogs can lighten or darken their skin for temperature regulation. Finally, animals can be coloured incidentally. For example, blood is red because the haem pigment needed to carry oxygen is red. Animals coloured in these ways can have striking natural patterns.
Animals produce colour in both direct and indirect ways. Direct production occurs through the presence of visible coloured cells known as pigment which are particles of coloured material such as freckles. Indirect production occurs by virtue of cells known as chromatophores which are pigment-containing cells such as hair follicles. The distribution of the pigment particles in the chromatophores can change under hormonal or neuronal control. For fishes it has been demonstrated that chromatophores may respond directly to environmental stimuli like visible light, UV-radiation, temperature, pH, chemicals, etc.  colour change helps individuals in becoming more or less visible and is important in agonistic displays and in camouflage. Some animals, including many butterflies and birds, have microscopic structures in scales, bristles or feathers which give them brilliant iridescent colours. Other animals including squid and some deep-sea fish can produce light, sometimes of different colours. Animals often use two or more of these mechanisms together to produce the colours and effects they need.
Animal coloration has been a topic of interest and research in biology for centuries. In the classical era, Aristotle recorded that the octopus was able to change its coloration to match its background, and when it was alarmed. 
The parts of the Feathers of this glorious Bird appear, through the Microscope, no less gaudy then do the whole Feathers; for, as to the naked eye 'tis evident that the stem or quill of each Feather in the tail sends out multitudes of Lateral branches, ... so each of those threads in the Microscope appears a large long body, consisting of a multitude of bright reflecting parts.
... their upper sides seem to me to consist of a multitude of thin plated bodies, which are exceeding thin, and lie very close together, and thereby, like mother of Pearl shells, do not onely reflect a very brisk light, but tinge that light in a most curious manner; and by means of various positions, in respect of the light, they reflect back now one colour, and then another, and those most vividly. Now, that these colours are onely fantastical ones, that is, such as arise immediately from the refractions of the light, I found by this, that water wetting these colour'd parts, destroy'd their colours, which seem'd to proceed from the alteration of the reflection and refraction.— Robert Hooke 
According to Charles Darwin's 1859 theory of natural selection, features such as coloration evolved by providing individual animals with a reproductive advantage. For example, individuals with slightly better camouflage than others of the same species would, on average, leave more offspring. In his Origin of Species, Darwin wrote: 
When we see leaf-eating insects green, and bark-feeders mottled-grey; the alpine ptarmigan white in winter, the red-grouse the colour of heather, and the black-grouse that of peaty earth, we must believe that these tints are of service to these birds and insects in preserving them from danger. Grouse, if not destroyed at some period of their lives, would increase in countless numbers; they are known to suffer largely from birds of prey; and hawks are guided by eyesight to their prey, so much so, that on parts of the Continent persons are warned not to keep white pigeons, as being the most liable to destruction. Hence I can see no reason to doubt that natural selection might be most effective in giving the proper colour to each kind of grouse, and in keeping that colour, when once acquired, true and constant.— Charles Darwin 
Henry Walter Bates's 1863 book The Naturalist on the River Amazons describes his extensive studies of the insects in the Amazon basin, and especially the butterflies. He discovered that apparently similar butterflies often belonged to different families, with a harmless species mimicking a poisonous or bitter-tasting species to reduce its chance of being attacked by a predator, in the process now called after him, Batesian mimicry. 
Edward Bagnall Poulton's strongly Darwinian 1890 book The Colours of Animals, their meaning and use, especially considered in the case of insects argued the case for three aspects of animal coloration that are broadly accepted today but were controversial or wholly new at the time.   It strongly supported Darwin's theory of sexual selection, arguing that the obvious differences between male and female birds such as the argus pheasant were selected by the females, pointing out that bright male plumage was found only in species "which court by day".  The book introduced the concept of frequency-dependent selection, as when edible mimics are less frequent than the distasteful models whose colours and patterns they copy. In the book, Poulton also coined the term aposematism for warning coloration, which he identified in widely differing animal groups including mammals (such as the skunk), bees and wasps, beetles, and butterflies. 
Frank Evers Beddard's 1892 book, Animal Coloration, acknowledged that natural selection existed but examined its application to camouflage, mimicry and sexual selection very critically.   The book was in turn roundly criticised by Poulton. 
Abbott Handerson Thayer's 1909 book Concealing-Coloration in the Animal Kingdom, completed by his son Gerald H. Thayer, argued correctly for the widespread use of crypsis among animals, and in particular described and explained countershading for the first time. However, the Thayers spoilt their case by arguing that camouflage was the sole purpose of animal coloration, which led them to claim that even the brilliant pink plumage of the flamingo or the roseate spoonbill was cryptic—against the momentarily pink sky at dawn or dusk. As a result, the book was mocked by critics including Theodore Roosevelt as having "pushed [the "doctrine" of concealing coloration] to such a fantastic extreme and to include such wild absurdities as to call for the application of common sense thereto."  
Hugh Bamford Cott's 500-page book Adaptive Coloration in Animals, published in wartime 1940, systematically described the principles of camouflage and mimicry. The book contains hundreds of examples, over a hundred photographs and Cott's own accurate and artistic drawings, and 27 pages of references. Cott focussed especially on "maximum disruptive contrast", the kind of patterning used in military camouflage such as disruptive pattern material. Indeed, Cott describes such applications: 
the effect of a disruptive pattern is to break up what is really a continuous surface into what appears to be a number of discontinuous surfaces... which contradict the shape of the body on which they are superimposed.— Hugh Cott 
Animal coloration provided important early evidence for evolution by natural selection, at a time when little direct evidence was available.    
One of the pioneers of research into animal coloration, Edward Bagnall Poulton  classified the forms of protective coloration, in a way which is still helpful. He described: protective resemblance; aggressive resemblance; adventitious protection; and variable protective resemblance.  These are covered in turn below.
Protective resemblance is used by prey to avoid predation. It includes special protective resemblance, now called mimesis, where the whole animal looks like some other object, for example when a caterpillar resembles a twig or a bird dropping. In general protective resemblance, now called crypsis, the animal's texture blends with the background, for example when a moth's colour and pattern blend in with tree bark. 
Aggressive resemblance is used by predators or parasites. In special aggressive resemblance, the animal looks like something else, luring the prey or host to approach, for example when a flower mantis resembles a particular kind of flower, such as an orchid. In general aggressive resemblance, the predator or parasite blends in with the background, for example when a leopard is hard to see in long grass. 
For adventitious protection, an animal uses materials such as twigs, sand, or pieces of shell to conceal its outline, for example when a caddis fly larva builds a decorated case, or when a decorator crab decorates its back with seaweed, sponges and stones. 
In variable protective resemblance, an animal such as a chameleon, flatfish, squid or octopus changes its skin pattern and colour using special chromatophore cells to resemble whatever background it is currently resting on (as well as for signalling). 
The main mechanisms to create the resemblances described by Poulton – whether in nature or in military applications – are crypsis, blending into the background so as to become hard to see (this covers both special and general resemblance); disruptive patterning, using colour and pattern to break up the animal's outline, which relates mainly to general resemblance; mimesis, resembling other objects of no special interest to the observer, which relates to special resemblance; countershading, using graded colour to create the illusion of flatness, which relates mainly to general resemblance; and counterillumination, producing light to match the background, notably in some species of squid. 
Countershading was first described by the American artist Abbott Handerson Thayer, a pioneer in the theory of animal coloration. Thayer observed that whereas a painter takes a flat canvas and uses coloured paint to create the illusion of solidity by painting in shadows, animals such as deer are often darkest on their backs, becoming lighter towards the belly, creating (as zoologist Hugh Cott observed) the illusion of flatness,  and against a matching background, of invisibility. Thayer's observation "Animals are painted by Nature, darkest on those parts which tend to be most lighted by the sky's light, and vice versa" is called Thayer's Law. 
colour is widely used for signalling in animals as diverse as birds and shrimps. Signalling encompasses at least three purposes:
Advertising coloration can signal the services an animal offers to other animals. These may be of the same species, as in sexual selection, or of different species, as in cleaning symbiosis. Signals, which often combine colour and movement, may be understood by many different species; for example, the cleaning stations of the banded coral shrimp Stenopus hispidus are visited by different species of fish, and even by reptiles such as hawksbill sea turtles.   
Darwin observed that the males of some species, such as birds-of-paradise, were very different from the females.
Darwin explained such male-female differences in his theory of sexual selection in his book The Descent of Man.  Once the females begin to select males according to any particular characteristic, such as a long tail or a coloured crest, that characteristic is emphasized more and more in the males. Eventually all the males will have the characteristics that the females are sexually selecting for, as only those males can reproduce. This mechanism is powerful enough to create features that are strongly disadvantageous to the males in other ways. For example, some male birds-of-paradise have wing or tail streamers that are so long that they impede flight, while their brilliant colours may make the males more vulnerable to predators. In the extreme, sexual selection may drive species to extinction, as has been argued for the enormous horns of the male Irish elk, which may have made it difficult for mature males to move and feed. 
Different forms of sexual selection are possible, including rivalry among males, and selection of females by males.
Warning coloration (aposematism) is effectively the "opposite" of camouflage, and a special case of advertising. Its function is to make the animal, for example a wasp or a coral snake, highly conspicuous to potential predators, so that it is noticed, remembered, and then avoided. As Peter Forbes observes, "Human warning signs employ the same colours – red, yellow, black, and white – that nature uses to advertise dangerous creatures."  Warning colours work by being associated by potential predators with something that makes the warning coloured animal unpleasant or dangerous.  This can be achieved in several ways, by being any combination of:
Warning coloration can succeed either through inborn behaviour ( instinct) on the part of potential predators,  or through a learned avoidance. Either can lead to various forms of mimicry. Experiments show that avoidance is learned in birds,  mammals,  lizards,  and amphibians,  but that some birds such as great tits have inborn avoidance of certain colours and patterns such as black and yellow stripes. 
Mimicry means that one species of animal resembles another species closely enough to deceive predators. To evolve, the mimicked species must have warning coloration, because appearing to be bitter-tasting or dangerous gives natural selection something to work on. Once a species has a slight, chance, resemblance to a warning coloured species, natural selection can drive its colours and patterns towards more perfect mimicry. There are numerous possible mechanisms, of which the best known are:
Batesian mimicry was first described by the pioneering naturalist Henry W. Bates. When an edible prey animal comes to resemble, even slightly, a distasteful animal, natural selection favours those individuals that even very slightly better resemble the distasteful species. This is because even a small degree of protection reduces predation and increases the chance that an individual mimic will survive and reproduce. For example, many species of hoverfly are coloured black and yellow like bees, and are in consequence avoided by birds (and people). 
Müllerian mimicry was first described by the pioneering naturalist Fritz Müller. When a distasteful animal comes to resemble a more common distasteful animal, natural selection favours individuals that even very slightly better resemble the target. For example, many species of stinging wasp and bee are similarly coloured black and yellow. Müller's explanation of the mechanism for this was one of the first uses of mathematics in biology. He argued that a predator, such as a young bird, must attack at least one insect, say a wasp, to learn that the black and yellow colours mean a stinging insect. If bees were differently coloured, the young bird would have to attack one of them also. But when bees and wasps resemble each other, the young bird need only attack one from the whole group to learn to avoid all of them. So, fewer bees are attacked if they mimic wasps; the same applies to wasps that mimic bees. The result is mutual resemblance for mutual protection. 
Some animals such as many moths, mantises and grasshoppers, have a repertoire of threatening or startling behaviour, such as suddenly displaying conspicuous eyespots or patches of bright and contrasting colours, so as to scare off or momentarily distract a predator. This gives the prey animal an opportunity to escape. The behaviour is deimatic (startling) rather than aposematic as these insects are palatable to predators, so the warning colours are a bluff, not an honest signal.  
Some prey animals such as zebra are marked with high-contrast patterns which possibly help to confuse their predators, such as lions, during a chase. The bold stripes of a herd of running zebra have been claimed make it difficult for predators to estimate the prey's speed and direction accurately, or to identify individual animals, giving the prey an improved chance of escape.  Since dazzle patterns (such as the zebra's stripes) make animals harder to catch when moving, but easier to detect when stationary, there is an evolutionary trade-off between dazzle and camouflage.  There is evidence that the zebra's stripes could provide some protection from flies and biting insects. 
Many animals have dark pigments such as melanin in their skin, eyes and fur to protect themselves against sunburn  (damage to living tissues caused by ultraviolet light).   Another example of photoprotective pigments are the GFP-like proteins in some corals.  In some jellyfish, rhizostomins have also been hypothesized to protect against ultraviolet damage. 
Some animals are coloured purely incidentally because their blood contains pigments. For example, amphibians like the olm that live in caves may be largely colorless as colour has no function in that environment, but they show some red because of the haem pigment in their red blood cells, needed to carry oxygen. They also have a little orange coloured riboflavin in their skin.  Human albinos and people with fair skin have a similar colour for the same reason. 
Pigments are coloured chemicals (such as melanin) in animal tissues.  For example, the Arctic fox has a white coat in winter (containing little pigment), and a brown coat in summer (containing more pigment), an example of seasonal camouflage (a polyphenism). Many animals, including mammals, birds, and amphibians, are unable to synthesize most of the pigments that colour their fur or feathers, other than the brown or black melanins that give many mammals their earth tones.  For example, the bright yellow of an American goldfinch, the startling orange of a juvenile red-spotted newt, the deep red of a cardinal and the pink of a flamingo are all produced by carotenoid pigments synthesized by plants. In the case of the flamingo, the bird eats pink shrimps, which are themselves unable to synthesize carotenoids. The shrimps derive their body colour from microscopic red algae, which like most plants are able to create their own pigments, including both carotenoids and (green) chlorophyll. Animals that eat green plants do not become green, however, as chlorophyll does not survive digestion. 
Chromatophores are special pigment-containing cells that may change their size, but more often retain their original size but allow the pigment within them to become redistributed, thus varying the colour and pattern of the animal. Chromatophores may respond to hormonal and/or neurobal control mechanisms, but direst responses to stimulation by visible light, UV-radiation, temperature, pH-changes, chemicals, etc. have also been documented.  The voluntary control of chromatophores is known as metachrosis.  For example, cuttlefish and chameleons can rapidly change their appearance, both for camouflage and for signalling, as Aristotle first noted over 2000 years ago: 
The octopus ... seeks its prey by so changing its colour as to render it like the colour of the stones adjacent to it; it does so also when alarmed.— Aristotle
When cephalopod molluscs like squid and cuttlefish find themselves against a light background, they contract many of their chromatophores, concentrating the pigment into a smaller area, resulting in a pattern of tiny, dense, but widely spaced dots, appearing light. When they enter a darker environment, they allow their chromatophores to expand, creating a pattern of larger dark spots, and making their bodies appear dark.  Amphibians such as frogs have three kinds of star-shaped chromatophore cells in separate layers of their skin. The top layer contains ' xanthophores' with orange, red, or yellow pigments; the middle layer contains ' iridophores' with a silvery light-reflecting pigment; while the bottom layer contains ' melanophores' with dark melanin. 
While many animals are unable to synthesize carotenoid pigments to create red and yellow surfaces, the green and blue colours of bird feathers and insect carapaces are usually not produced by pigments at all, but by structural coloration.  Structural coloration means the production of colour by microscopically-structured surfaces fine enough to interfere with visible light, sometimes in combination with pigments: for example, peacock tail feathers are pigmented brown, but their structure makes them appear blue, turquoise and green. Structural coloration can produce the most brilliant colours, often iridescent.  For example, the blue/green gloss on the plumage of birds such as ducks, and the purple/blue/green/red colours of many beetles and butterflies are created by structural coloration.  Animals use several methods to produce structural colour, as described in the table. 
|Diffraction grating||layers of chitin and air||Iridescent colours of butterfly wing scales, peacock feathers |
|Diffraction grating||tree-shaped arrays of chitin||Morpho butterfly wing scales |
|Selective mirrors||micron-sized dimples lined with chitin layers||Papilio palinurus, emerald swallowtail butterfly wing scales |
|Photonic crystals||arrays of nano-sized holes||Cattleheart butterfly wing scales |
|Crystal fibres||hexagonal arrays of hollow nanofibres||Aphrodita, sea mouse spines |
|Deformed matrices||random nanochannels in spongelike keratin||Diffuse non-iridescent blue of Ara ararauna, blue-and-yellow macaw |
|Reversible proteins||reflectin proteins controlled by electric charge||Iridophore cells in Doryteuthis pealeii squid skin |
Bioluminescence is the production of light, such as by the photophores of marine animals,  and the tails of glow-worms and fireflies. Bioluminescence, like other forms of metabolism, releases energy derived from the chemical energy of food. A pigment, luciferin is catalysed by the enzyme luciferase to react with oxygen, releasing light.  Comb jellies such as Euplokamis are bioluminescent, creating blue and green light, especially when stressed; when disturbed, they secrete an ink which luminesces in the same colours. Since comb jellies are not very sensitive to light, their bioluminescence is unlikely to be used to signal to other members of the same species (e.g. to attract mates or repel rivals); more likely, the light helps to distract predators or parasites.  Some species of squid have light-producing organs ( photophores) scattered all over their undersides that create a sparkling glow. This provides counter-illumination camouflage, preventing the animal from appearing as a dark shape when seen from below.  Some anglerfish of the deep sea, where it is too dark to hunt by sight, contain symbiotic bacteria in the 'bait' on their 'fishing rods'. These emit light to attract prey.