Polymer composites with smart optical properties