Chameleons change color through a specialized cell layer called chromatophores in their skin. These cells contain pigments that can expand or contract, allowing the chameleon to change its color by adjusting the distribution of these pigments in their skin. This color change is mainly used for communication, camouflage, and thermoregulation.