Color blindness occurs when there is a mutation in one of the opsin genes that prevents the cones containing that pigment from detecting colored light in the normal way. Two of the three genes for the pigment molecules specifically, the genes for red and green cone pigments are located on the X chromosome. Since males have only one X chromosome, they have only one chance to get good copies of the red and green pigment genes. If there is a mutation in one of these pigment genes that impairs the light-absorbing properties of the opsin, then a male will have a common form of color blindness, characterized by an inability to distinguish shades of red and green normally.
Females have two X chromosomes.
Therefore, red-green color blindness is less common among females than males. The pigment in rods, the photoreceptor sensitive to low light levels, has peak sensitivity only for greenish blue light. That's why humans lose their color vision at night and also why theaters use such light to indicate night scenes. Sometimes a mutation in the red or green pigment simply shifts the peak sensitivity of the two pigments closer together. For example, a person might end up with reddish green and green pigments instead of red and green pigments.