I have created a Venn diagram using Processing, however, I can either make solid RGB colours, or use an alpha value (RGBA) to give the objects transparency, but I wondered if there was an existing function inside Processing to blend the overlapping parts of the objects whilst leaving the non-overlapping parts the original colour?
void setup(){
size(500,500);
}
void draw(){
background(255);
noStroke();
fill(255,0,0); // r
ellipse(width/2, height/3, width/4, height/4);
fill(0,255,0); // g
ellipse(width/2.75, height/3, width/4, height/4);
fill(0,0,255); // b
ellipse(width/2.25, height/2.25, width/4, height/4);
}
Above code produces 3 solid, overlapping shapes:
void setup(){
size(500,500);
}
void draw(){
background(255);
noStroke();
fill(255,0,0, 120); // ra
ellipse(width/2, height/3, width/4, height/4);
fill(0,255,0, 120); // ga
ellipse(width/2.75, height/3, width/4, height/4);
fill(0,0,255,120); // ba
ellipse(width/2.25, height/2.25, width/4, height/4);
}
Above code produces 3 transparent, overlapping shapes:
Is there an existing function I use to make the overlapping objects appear as below?
Thanks