How to choose n different colors automatically to build n different objects?

I need to draw n different objects in a diagram. I want to choose a different color for each of them to make them distinguishable. The objects will be moved, so I cannot count on ideas such as the β€œfour-color theorem” to assign the same color to non-adjacent elements. So far, my problem requires up to 20 different elements.

Is there a good way to choose n different colors to make them as distinct as possible from each other?

+6
design colors image data-visualization visualization
source share
3 answers

First of all, since then I changed the design, so it is not important to use 20 different colors. The default palette of 10 colors is displayed pretty well.

Secondly, I found the answer to my question. The thing I want to do is called the Color Scale for categorical coding . Here is a document that suggests a method for this

Algorithm for generating color scales for both categorical and ordinal coding - Breslow - 2009 - Color research and application - Wiley Internet library http://onlinelibrary.wiley.com/doi/10.1002/col.20559/full

I'm going to glance at the paper. This is probably too technical than what I am willing to do.

+2
source share

I would say that the difference in color is a very subjective question, and you are probably better off looking for an existing color palette and working from there. The higher your n, the higher the likelihood that your automatically generated colors will be indistinguishable from your users, although by some color-theoretical criterion they are very different.

And don't forget to make sure that you are not using color as the only difference between objects or:

  • you will have many hated letters from color blind people.
  • you risk that people mistakenly accept objects of the same color that have some kind of implicit grouping
+1
source share

Do you really need to use 20 different colors? These are many colors, if you still want people to be able to distinguish them. Also understand that people who are color blind will be lost by looking at your charts. 10% of men are blindly stained . It would be better if you could decompose your objects into two to five groups. Then you can use different shapes as well as color to distinguish objects. For example, you may have crosses, circles, triangles, stars and squares in four different colors, as shown here: alt text

To select colors, I would look at the color of the brewer . However, note that it does not reach 20 colors.

+1
source share

All Articles