This is related to the energy carried by photons of light the energy of each photon is proportional to the frequency of the light since red light has a lower frequency then violet light and photons of red light carry less energy than the photons of violet light as a result the red protons eject electrons that have less energy than the ejected electrons by Violet photons