Chameleons change color through a specialized layer of cells called chromatophores in their skin. These cells contain pigments that can expand or contract, allowing the chameleon to absorb or reflect different wavelengths of light. Additionally, chameleons can change color based on their mood, temperature regulation, and communication with other chameleons.