As a complement to Carlo Beenakker's very good answer, I suggest to have a look at the palettes proposed by Paul Tol. He purports to answer the very questions you asked. You can find his work summarised on his [webpage][1], which includes a link to his detailed [technical note][2] on colour schemes.


  [1]: https://personal.sron.nl/~pault/
  [2]: https://personal.sron.nl/~pault/colourschemes.pdf