From htang at hpl.hp.com  Wed Oct 29 01:54:52 2003
From: htang at hpl.hp.com (htang@hpl.hp.com)
Date: Wed Oct 29 01:53:53 2003
Subject: [Rd] Wishlist: user-specified color names for palette() (PR#4836)
Message-ID: <200310290054.h9T0sq0P001792@pubhealth.ku.dk>

Full_Name: Hsiu-Khuern Tang
Version: 1.8.0
OS: GNU/Linux (Debian unstable)
Submission from: (NULL) (156.153.255.243)


Hi,

   I use palette(rgb(red=..., green=..., blue=..., names=mycolors)) to define my
own color palette.  After doing this, the names `mycolors' are not stored in
palette() anymore, so that palette() returns a mix of built-in color names and
RGB values.

Eg:
> palette()
 [1] "black"   "#EAA200" "#FF6633" "gray60"

I wish that palette() would return a _named vector_ like this:

> palette()
    black    orange    tomato      gray 
  "#000000" "#EAA200" "#FF6633"  "#999999" 

One application:

I want to specify colors by name, where the names returned by palette() are
searched first.  If there is a match, the corresponding RGB value is used;
otherwise the built-in R color is used.

Best,
Hsiu-Khuern Tang.


[Rd] Wishlist: user-specified color names for palette() (PR#4836)
htang@hpl.hp.com