A more reliable and helpful approach is to make sure that colors meant to convey information are augmented by some other indicator (symbols/shapes, text labels, line styles, etc.) whenever possible. In addition to avoiding colorblindness issues, this makes the difference easier to recognize in general. It also helps accommodate non-ideal viewing conditions such as a washed-out display, coordinating between displays that are calibrated differently, monochrome print/e-ink, and so on.
https://en.wikipedia.org/wiki/Color_blindness#Types