Chromogenic and fluorogenic materials based on micro and nanocapsules