Temperature-controlled switchable photochromism in solid materials