How Color Vision Testing Works
A color vision test pattern for testing red/green deficiency starts
from a random pattern of gray level dots.

We now add a digit pattern which is defined by yellow/blue
variation only. This pattern can be detected by any observer which is
able to do yellow/blue discrimination. Since most people with
red/green deficiency will be able to do yellow/blue discrimination
they will be able to see the digit 5 in this test pattern.

Now we add another digit pattern which is defined by red/green
variation and is easier to see than the pattern defined by yellow/blue
variation. Here is the pattern composed of the random brightness
pattern and the red/green pattern:

Finally we add all three components: the random brightness
pattern, the yellow/blue pattern, and the red/green pattern. Observers
with red/green deficiency will not be able to see the red/green
pattern and base their response on the yellow/blue pattern
only. Normal observers will see both the yellow/blue and the red/green
pattern. Since the red/green pattern is stronger than the yellow/blue
pattern the normal subject will base his or her judgement on the
red/green pattern and see the digit 6.

Image source: Ishihara Color Test.