Chameleons change color in order to blend in with their surroundings. This makes it more difficult for their enemies- or their prey- to see them.
Chameleons have a transparent outer skin, with several skin layers underneath it that contain special cells called chromatophores contain sacks of color pigments that can contract and expand in response to internal signals. For example, if a chameleon became excited, it turns red by causing the red cells to fully expand, blocking out the other colors that are underneath the skin. Once it has calmed down, it becomes green again by allowing the red cells to contract.
Chameleons can expand and contract their color cells in such a way as to create a whole variety of colors and patterns. Light, temperature, and its emotional state can also bring about a chameleon's change in color. The chameleon's change in color. The chameleon will most often change between green, brown and gray, which coincidentally, often match the background colors of their habitats.