Chameleons change color primarily to regulate their body temperature and to communicate with other chameleons. They have specialized cells called chromatophores in their skin that contain different pigments. By expanding or contracting these cells, chameleons can alter the wavelengths of light that are reflected, resulting in a change of color. Additionally, their color change can also be influenced by mood, health, and environmental factors.