A rainbow is a meteorological phenomenon that is caused by reflection, refraction and dispersion of light in water droplets resulting…