Controlled gradient colloidal photonic crystals and their optical properties