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

(Ted Harding) Ted.Harding at nessie.mcc.ac.uk
Tue Dec 21 14:02:10 CET 2004

On 21-Dec-04 michael watson \(IAH-C\) wrote:
> Hi
> I want to create a vector of colors that are as different
> from one another as possible.  ?rainbow states "Conceptually,
> all of these functions actually use (parts of) a line cut out
> of the 3-dimensional color space...".  This suggests to me
> that the resulting colors are all placed on this "line" and
> are equi-distant along it.  The resulting color palette is
> a range of colours where adjacent colours are actually quite
> similar, especially when n (the number of colours) is high.
> 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)

One is not enough, by a long way, in my experience ...

How large is n? It's not easy to select more than a few clearly
distinct colours. Also, "distinct" is context-dependent, because:

What will be the spatial relationships of the different colours
in your output? You can successfully have fairly similar
colours adjacent to each other, since the contrast is more
obvious when they're adjacent. However, if you want to use
colours to track identity and difference across scttered points
or patches, then you need bigger separations between colours,
since you want to be able to see easily that patch "A" here is
of the same kind as patch "A" there and different from patch "B"
somwehere else, when mingled with patches of other kinds.

And size matters. Big patches of similar colour (as on a map)
can look quite distinct, while the same colours used to plot
filled circular blobs on a graph might be barely distinguishable,
and totally undistinguishable if used to plot coloured "."s
or "+"s.

It depends too on what you will be using to render the colours.
Monitor screens vary in their aility to render different
colours distinctly, and so do colour printers.

It's all very psycho-visual and success usually requires


E-Mail: (Ted Harding) <Ted.Harding at nessie.mcc.ac.uk>
Fax-to-email: +44 (0)870 094 0861  [NB: New number!]
Date: 21-Dec-04                                       Time: 13:02:10
------------------------------ XFMail ------------------------------

More information about the R-help mailing list