Tuning the bandgap for polymeric smart windows and displays