Quantcast

RGB components of plot() colours

classic Classic list List threaded Threaded
3 messages Options
Reply | Threaded
Open this post in threaded view
|  
Report Content as Inappropriate
star

RGB components of plot() colours

ted.harding-3
A quick question:

Is there anywhere a listing of the RGB components of the
named colours listed by colors()?

For example, where would I find the RGB for "orange1"
or "salmon"?

When I look at an EPS file from R where I have used
these colours, it seems that for:

"salmon":
0.9804 0.5020 0.4471 rgb

"orange1":
1 0.6471 0 rgb

However, this is a tedious way of finding out!

With thanks,
Ted.

-------------------------------------------------
E-Mail: (Ted Harding) <[hidden email]>
Date: 10-Jul-2012  Time: 14:05:15
This message was sent by XFMail

______________________________________________
[hidden email] mailing list
https://stat.ethz.ch/mailman/listinfo/r-help
PLEASE do read the posting guide http://www.R-project.org/posting-guide.html
and provide commented, minimal, self-contained, reproducible code.
Reply | Threaded
Open this post in threaded view
|  
Report Content as Inappropriate
star

Re: RGB components of plot() colours

Duncan Murdoch-2
On 12-07-10 9:05 AM, (Ted Harding) wrote:

> A quick question:
>
> Is there anywhere a listing of the RGB components of the
> named colours listed by colors()?
>
> For example, where would I find the RGB for "orange1"
> or "salmon"?
>
> When I look at an EPS file from R where I have used
> these colours, it seems that for:
>
> "salmon":
> 0.9804 0.5020 0.4471 rgb
>
> "orange1":
> 1 0.6471 0 rgb
>
> However, this is a tedious way of finding out!

col2rgb("salmon")
       [,1]
red    250
green  128
blue   114

Those need to be divided by 255 to get the colours on the 0-1 scale.

Duncan Murdoch

______________________________________________
[hidden email] mailing list
https://stat.ethz.ch/mailman/listinfo/r-help
PLEASE do read the posting guide http://www.R-project.org/posting-guide.html
and provide commented, minimal, self-contained, reproducible code.
Reply | Threaded
Open this post in threaded view
|  
Report Content as Inappropriate
star

Re: RGB components of plot() colours

Sarah Goslee
In reply to this post by ted.harding-3
R uses the sandard X11 colors, I believe, and if you're using linux there's
a rgb.txt file on your computer that contains them.

It's also available here
http://cvsweb.xfree86.org/cvsweb/*checkout*/xc/programs/rgb/rgb.txt?rev=1.1

and a less-authoritative but prettier version:
http://en.wikipedia.org/wiki/X11_color_names

Within R, colors() is what you need. See here for an exhaustive discussion:
http://research.stowers-institute.org/efg/R/Color/Chart/

Sarah

On Tuesday, July 10, 2012, Ted Harding wrote:

> A quick question:
>
> Is there anywhere a listing of the RGB components of the
> named colours listed by colors()?
>
> For example, where would I find the RGB for "orange1"
> or "salmon"?
>
> When I look at an EPS file from R where I have used
> these colours, it seems that for:
>
> "salmon":
> 0.9804 0.5020 0.4471 rgb
>
> "orange1":
> 1 0.6471 0 rgb
>
> However, this is a tedious way of finding out!
>
> With thanks,
> Ted.
>
> -------------------------------------------------
> E-Mail: (Ted Harding) <[hidden email] <javascript:;>>
> Date: 10-Jul-2012  Time: 14:05:15
> This message was sent by XFMail
>
> ______________________________________________
> [hidden email] <javascript:;> mailing list
> https://stat.ethz.ch/mailman/listinfo/r-help
> PLEASE do read the posting guide
> http://www.R-project.org/posting-guide.html
> and provide commented, minimal, self-contained, reproducible code.
>


--
Sarah Goslee
http://www.stringpage.com
http://www.sarahgoslee.com
http://www.functionaldiversity.org

        [[alternative HTML version deleted]]

______________________________________________
[hidden email] mailing list
https://stat.ethz.ch/mailman/listinfo/r-help
PLEASE do read the posting guide http://www.R-project.org/posting-guide.html
and provide commented, minimal, self-contained, reproducible code.
Loading...