Photochromic and thermochromic spirans