There is evidence that the colors of bird feathers are due to carotenoids, which birds do not make themselves. Like fish, these carotenoids seem to come from their diets (Hill, Geoffery. National Geographic, 2008). A study by Juan Amat in Spain is the first to show that birds transfer these carotenoid pigments with secretions from their uropygial gland for different reasons. The Uropygial, also called the preen gland, is found in many birds near the base of their tail. Some birds can modify their color by applying substances from internal or external factors. One of these substances that can modify color is the secretion of the uropygial gland which may cause orange, red, or yellow pigmentation. Amat and colleagues studied the seasonal variations in feather color in relation to courtship activity of the greater flamingo, Phoenicopterus roseus, in Spain. They were searching for the pigments that caused the color of their plumage in the uropygial secretions on the surface of their feathers. They also assessed whether the flamingos had certain behaviors they used to acquire and maintain their plumage color. They also looked at the timing of their coloration with their reproductive patters (i.e. egg laying). Their results showed that flamingo feathers were more colorful when they were with groups, and got lighter during the rest of the year. Fading occurred shortly after the breeding season. They also found evidence that the uropygial carotenoids were transferred to their feathers by rubbing their head on their necks, breasts, and back feathers. Because rubbing and color were prominent when the flamingos were in groups, and faded during the rest of the year, researchers believe color is directly related to mating. "Our findings in flamingos have important implications for the theories of sexual selection and signaling, highlighting the key role of the manipulation of plumage color by the birds themselves to improve signal efficacy." (Amat Et Al, 2010)
Hill, Geoffrey. Bird Color Mysteries Explained, From National Geographic.
Image from: http://www.birding.in/birds/Phoenicopteriformes/Phoenicopteridae/greater_flamingo.htm