R-alpha: Colors -- Comment: yes, great !!

Martin Maechler Martin Maechler <maechler@stat.math.ethz.ch>
Thu, 7 Aug 1997 10:37:12 +0200


>>>>> "Ross" == Ross Ihaka <ihaka@stat.auckland.ac.nz> writes:

    Ross> Here is a proposal: At present when you specify a color with an
    Ross> integer it is taken as an index into a fixed table of 8 colors.
     
    Ross>    ....

    Ross> I would like to make the color table, user definable.  To do this
    Ross> there needs to be a function

    Ross> 	palette(name, value)

    Ross> where "name" could be used to select one on a number of standard
    Ross> built-in palettes (e.g. "default", "heat", "terrain", "pastels"
    Ross> etc) and (if name was not specified, "value" could be a character
    Ross> vector of color specifications (of length less than or equal to
    Ross> 256?).  Either names (e.g. "red", "lightblue" ...)  or by rgb
    Ross> values (e.g "#FF00FF") could be used in the vector.

You could even do with one argument -- collapsing  name & value.
	character(1) -> 'name'
	character(> 1) -> 'value'

But this may be just about the S practice 
which has been in use in functions like  diag(..) and
seems to confusing people..


    Ross> The function palette would return the previous palette, and
    Ross> palette() could be used to obtain the current settings without a
    Ross> change.

    Ross> After a call to palette integer col= specification would provide
    Ross> indexes into this table.

This sounds really great!
Just about what I may have dreamed when I sent my e-mail
a few weeks ago :-)



    Ross> col=0 could be used to indicate the current background color.
Yes, please

    Ross> The "default" palette would have 1=black.
Ok.
    Ross> Any comments?  Ross

Yes: Sounds great!
=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-
r-devel mailing list -- Read http://www.ci.tuwien.ac.at/~hornik/R/R-FAQ.html
Send "info", "help", or "[un]subscribe"
(in the "body", not the subject !)  To: r-devel-request@stat.math.ethz.ch
=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-