Enhanced photoelectrochemical and optical performance of ZnO films tuned by Cr doping