Re: [R] color blending and transparency

2010-02-03 Thread Thomas Lumley
On Wed, 3 Feb 2010, baptiste auguie wrote: Thanks for this complementary information. My head itches slightly when reading about these virtual layers with unidirectional absorption and reflection properties but I guess that's imputable to my personal background as a physicist. It's not unidire

Re: [R] color blending and transparency

2010-02-03 Thread baptiste auguie
Thanks for this complementary information. My head itches slightly when reading about these virtual layers with unidirectional absorption and reflection properties but I guess that's imputable to my personal background as a physicist. I still have a few questions, - is this behavior documented? (

Re: [R] color blending and transparency

2010-02-03 Thread baptiste auguie
On MacOSX I can tell Preview or Photoshop not to use a white background yet the mixing still shows a difference (with either pdf or png for that matter). So I guess it's something to do with mixing colours with the transparent channel as you say. I'll try to find the reason in the source code later

Re: [R] color blending and transparency

2010-02-03 Thread Thomas Lumley
On Wed, 3 Feb 2010, baptiste auguie wrote: That makes perfect sense, thank you, except that I'm not sure where the white comes from when I set the background to transparent? png("testingOrder.png", bg = "transparent") plot.new() par(bg="transparent") rect(0.3, 0.5, 1, 1, col=rgb(1, 0, 0, alpha=

Re: [R] color blending and transparency

2010-02-03 Thread Duncan Murdoch
On 03/02/2010 9:38 AM, baptiste auguie wrote: That makes perfect sense, thank you, except that I'm not sure where the white comes from when I set the background to transparent? You'd have to check the png device documentation or source code to find out what it does when you mix half red wit

Re: [R] color blending and transparency

2010-02-03 Thread baptiste auguie
That makes perfect sense, thank you, except that I'm not sure where the white comes from when I set the background to transparent? png("testingOrder.png", bg = "transparent") plot.new() par(bg="transparent") rect(0.3, 0.5, 1, 1, col=rgb(1, 0, 0, alpha=0.5)) rect(0, 0.5, 0.7, 1, col=rgb(0, 0, 1, al

Re: [R] color blending and transparency

2010-02-03 Thread Duncan Murdoch
On 03/02/2010 8:50 AM, Ken Knoblauch wrote: baptiste auguie googlemail.com> writes: Adding two semi-transparent colours results in non-intuitive colour mixing (a mystery for me anyway). Is it additive (light), substractive (paint), or something else? Consider the following example, depending on

Re: [R] color blending and transparency

2010-02-03 Thread Ken Knoblauch
baptiste auguie googlemail.com> writes: > Adding two semi-transparent colours results in non-intuitive colour > mixing (a mystery for me anyway). Is it additive (light), substractive > (paint), or something else? Consider the following example, depending > on the order of the two "layers" the over

Re: [R] color blending and transparency

2010-02-03 Thread baptiste auguie
Hi, Adding two semi-transparent colours results in non-intuitive colour mixing (a mystery for me anyway). Is it additive (light), substractive (paint), or something else? Consider the following example, depending on the order of the two "layers" the overlap region is either purple or dark red. I h

Re: [R] color blending and transparency

2010-02-03 Thread Jim Lemon
On 02/03/2010 08:43 PM, bluecuttlefish wrote: I am using ggplot and posted this question at that helplist. It was suggested that I try a more general R-help list for a possible solution to this problem. Within ggplot, I am using geom_area with red and blue and expect where they overlap should be

[R] color blending and transparency

2010-02-03 Thread bluecuttlefish
I am using ggplot and posted this question at that helplist. It was suggested that I try a more general R-help list for a possible solution to this problem. Within ggplot, I am using geom_area with red and blue and expect where they overlap should be purple. But instead, it's dark red. Playing wi