Facile fabrication of self-reporting micellar and vesicular structures based on an etching-ion exchange strategy of photonic composite spheres of poly(ionic liquid).