Under a chameleon’s outer skin are special skin cells with colour (or pigment) in them. These cells are called chromatophores. The top layer of chromatophores have red or yellow pigment. The lower layers have blue or white pigment. A chameleon changes colour when its brain sends a message to the cells. The message tells the cells to grow bigger or to shrink. When this happens, the cell pigments mix and the chameleon’s colour changes.

So, why does the chameleon change colour? Chameleons change colour in response to changes in the light, or temperature, or mood. When a boy chameleon wants to mate, for example, he flashes his most flamboyant colours to try and attract a female.

Temperature affects the chameleon’s colour too—if it’s cold, darker skin allows the chameleon to absorb more heat from the Sun. And, light from the Sun can signal a chameleon to change to a lighter shade, to reflect the sunlight. 
Chaemaleon contains cells called chraematophores . it contain Colo urful pigment. when brain sends message of any danger it changes its colour to protect itself from enemies.