Thermochromic windows capable of converting sunlight into electricity at a high efficiency have been developed. Relying on such advanced materials as perovskites and single-walled carbon nanotubes, the new technology responds to heat by transforming from transparent to tinted. As the window darkens, it generates electricity.