Chameleons change colors through specialized cells called chromatophores in their skin. By expanding or contracting these cells, chameleons can alter the wavelengths of light that are reflected, resulting in different colors and patterns.