@Globaltom
Right. When that's the objective, the palette would ideally be one which is distinct even with color sight issues, which rainbow is not. That's not an easy target though! Combining colors with symbols, patterns, border widths etc are things that could help. When I was studying the topic, this was a helpful post:
davidmathlogic.com/colorblind/