Whenever you see some trait in an animal, you need to think about why that trait would help the animal to survive or why it would help the animal to be successful in reproducing. (Unless it is a domesticated animal where people have selected for traits that they want). This is because natural selection only selects traits that do those things.
With most animals, the reason to be colorful is to attract a mate. Being colorful can help the animal to be seen by potential mates. In addition, the colors can serve as something of a sign of health. If an animal of the opposite sex sees a colorful animal, it knows that animal is healthy and would likely be a good mate. (Good meaning that it would have good genes to pass along).
The most vulnerable species from nature use successfully the camouflage, through their colors of the skin, to avoid the predators. Researchers believe that they have found out why animals which have natural means of self defense against predators, such as venom, however, tend to be colorful.
Defenseless creatures sometimes tend to imitate the poisonous or dangerous predators. Therefore throughout evolution, animals that possess effective defenses have changed their appearance, to be as difficult to be imitated by followers of camouflage and mimicry. The development of these poisonous species toward a flamboyant appearance has the inverse meaning of camouflage: the animal wants to be known as exactly who it is, the colorful aspect being it's "trademark".
Based on the Darwin's theory of evolution we can say that animals have acquired different colours and other many different characteristics from a limited number of organism varieties by a process of many very small random mutations that have taken place over many millions of years. Please not that the theory of Darwin does not explain why or how these random changes take place. It only explains how the cumulative effect of there random changes together with environmental factors present in different physical environment leads to survival of organism with certain type of mutations while extinction of organism with other type of animals. Thus it does no explain why crows are black. It only says that crows with black colour survived while those with other colours became extinct.
However, ones we accept that animals have different patterns of colour we are able to see that their colour pattern helps them in several different ways such as camouflage, attracting mates from the opposite sex and distinguishing members of own species from those of other species.