Solution processable and optically switchable 1D photonic structures