[R-gregmisc-users] SF.net SVN: r-gregmisc: [1050] trunk/gplots
Brought to you by:
warnes
From: <wa...@us...> - 2007-02-08 21:56:29
|
Revision: 1050 http://svn.sourceforge.net/r-gregmisc/?rev=1050&view=rev Author: warnes Date: 2007-02-08 13:56:22 -0800 (Thu, 08 Feb 2007) Log Message: ----------- Add col2rgb() function to convert color names to rgb hex codes Added Paths: ----------- trunk/gplots/R/col2hex.R trunk/gplots/man/col2hex.Rd Added: trunk/gplots/R/col2hex.R =================================================================== --- trunk/gplots/R/col2hex.R (rev 0) +++ trunk/gplots/R/col2hex.R 2007-02-08 21:56:22 UTC (rev 1050) @@ -0,0 +1,9 @@ +col2hex <- function(cname) + { + colMat <- col2rgb(cname) + rgb( + red=colMat[1,]/255, + blue=colMat[2,]/255, + green=colMat[3,]/255 + ) + } Added: trunk/gplots/man/col2hex.Rd =================================================================== --- trunk/gplots/man/col2hex.Rd (rev 0) +++ trunk/gplots/man/col2hex.Rd 2007-02-08 21:56:22 UTC (rev 1050) @@ -0,0 +1,24 @@ +\name{col2hex} +\alias{col2hex} +\title{Convert color names to hex RGB strings} +\description{ + Convert color names to hex RGB strings +} +\usage{ +col2hex(cname) +} +\arguments{ + \item{cname}{Color name(s)} +} +\value{ + Character vector giving the hex color code translation of the provided + color names. +} +\author{Gregory R. Warnes} +\seealso{ + \code{\link{col2rgb}}, \code{\link{colors}}, \code{\link{rgb}} + } +\examples{ +col2hex(c("red","yellow","lightgrey")) +} +\keyword{color} This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site. |