To get a feeling of what it's like to be color blind, you can use color blindness simulators such as ColorOracle. ColorOracle is able to simulate most types of color blindness: Deuteranopia (most common type), Protanopia (rare) or Tritanopia (extremely rare).
The working principle behind these simulators is based on the current color vision theory. People with normal color vision perceived colors thanks to sensors called "cones". There are 3 types of cones:
- S cones: with a strong response to blue
- M cones : with a strong response to green
- L cones : with a strong response to red
The eyes and then the brain calculate our color perception based on this 3 dimensional stimuli. A yellow color, for instance, would be almost no S cone stimuli and equal amount of stimuli for M and L cones. For more details on the color vision theory you can see here and in particular the the trichromatic theory and the opponent process theory.
If you are color blind however, you are usually missing a cone, or have a cone with a shifted response towards another color: for instance instead of a M Cone responding strongest to green, you might have a Cone whose response is shifted toward red. Your brain and eyes have then to deal with an almost 2 dimensional color stimuli: "blue", "somewhat red-green", "red". Hence you have more difficulty telling appart red and green colors.
That's basically how color blindness simulators work. They take the 3D normal color vision and map it onto a 2D color blind vision with the reduced color spectrum.
That's an invaluable insight when working with accessibility in mind to help you improve your color coding. But also keep in mind that color blind people tend to rely less on colors than people with normal color vision. You can easily reinforce color coding with shape coding. See advanced guidelines for that.