Fabrication of refractive index distributions in polymer using a photochemical reaction