[R] Creating a vector of colours that are as different from one another as possible

Thomas Lumley tlumley at u.washington.edu
Tue Dec 21 17:04:17 CET 2004


On Tue, 21 Dec 2004, michael watson (IAH-C) wrote:
>
> Conceptually I guess what I want is colors from a 3D polygon in 3D
> colour space, where the number of vertices in the polygon is n,
> resulting in a color palette where the colors are all quite different
> from one another.  Is this possible or am I talking crap? (I've only had
> one coffee this morning)
>

It depends on whether you need the colors to be different colors or 
whether lightness and saturation differences are ok.  For example, a cube 
with edges parallel to the axes in RGB space will have quite strong 
lightness differences, and will probably have visible saturation 
differences (depending on exactly which cube it is).  Often this is a Bad 
Thing.


It's hard to get a large number of colours that are all obviously 
different.  The ColorBrewer palettes (which are optimised for map 
coloring) go up to 11, but some of these are sets of light/dark pairs. If 
you wanted small plotting symbols it would be even more difficult, since 
blue-yellow distinctions are less visible in small things and since you 
probably want higher saturation.

 	-thomas

 	-thomas




More information about the R-help mailing list