Chameleons change color by expanding and contracting little balls of pigment in their skin, thereby increasing and decreasing the amount of that color that we see. They have a number of different kinds of color-making cells (called chromatophores) that contain different pigments, and they can make a variety of colors by turning these cells on or off in different combinations (i.e. blue + yellow = green) (for more, see here).
The pigments in these chromatophore cells are composed of different chemicals that absorb different colors of light. An example of one of those chemicals is beta-carotene, which due to all the double bonds in its cool chemical structure, absorbs blue-green light:
|Chemicals with lots of alternating double and single bonds usually absorb light in the visible range, which means the light that bounces off them will be colorful.|
When sunlight hits a chameleon that has its beta-carotene-containing pigment balls expanded, the beta-carotene will subtract out the blue-green light making the resulting light appear orange-ish.
|The color wheel. When you subtract blue-green light from sunlight, the resulting light will be the color on the opposite side of the color wheel, in this case orange-ish. Plants absorb mainly red-orange and blue light, leaving the green light on the opposite side of the color wheel to hit our eyes--that's why plants are green!!|
Chameleons are not the only animals that contain beta-carotene and other molecules like it (known collectively as carotenoids). These molecules are also the reason that lobsters are red and flamingos are pink:
|Lobsters are red.|
|Flamingos are pink.|
This story starts to get more amazing here... Our (and other animals') ability to visually detect the pink of pink flamingos is dependent on carotenoids. Before we use them in vision, we split carotenoid molecules in half, creating the chemical known as retinal:
|Animals use oxygen to split beta-carotene molecules in half, making two retinal molecules that they use to see stuff (see here).|
Retinal then finds its way into our eyes, where it combines itself with a protein. Just like beta-carotene above, retinal absorbs light in the visible range, and when that happens, the cells in our eyes send a signal to our brain. Our brain receives similar signals from retinal-containing cells all over our eyes, and combines them to make an image (for more go here). Just like chameleons use different carotenoid-derived colored chemicals to make their bodies beautifully-colored, we use different carotenoid-derived colored chemicals to detect those beautiful bodies. Amazing! Nature has taken advantage of the light-absorbing structure of carotenoids for such different purposes!
UNITY OF LIFE CONCLUSION IMMINENT:
Animals generally can't make their own carotenoids, so they rely on eating plants as a source of these molecules (in fact, flamingos turn white if they are fed a carotenoid-free diet). BTW: this is why carrots are supposed to be good for your vision, because they contain large amounts of beta-carotene.
But plants don't make carotenoids just so we animals can steal them, plants make them so they can use them in photosynthesis. When carotenoids absorb light, they are absorbing energy from the sun, and plants use that energy to turn carbon dioxide and water into sugar and oxygen. Nature takes advantage of the light-absorbing structure of carotenoids for yet another purpose!
Animals like chameleons use carotenoids to change the color of their bodies, animals like us humans use carotenoids in our eyes to see these colors, and plants make it all possible by making the carotenoids which they use to capture solar energy! All life on earth is connected!