The working principle of photochromic compounds involves the absorption of photons, which leads to a change in their molecular structure. This structural change alters the compound's absorption spectrum, causing a visible color change. The process is reversible, meaning the compound can return to its original state when the light source is removed or replaced by a different wavelength.