Tunable solid-state photochromism based on proton and anion-controlled structural transformation of pyridinium-based organic small molecules.