Thanks for the reply, but if I want to use the additive blending mode then I can do that only with a function like blendColor() right? And from what I know of the function I can use the blended color after specifying a region right? Or is there another way to do it?
- //Assuming I've defined my colors like red1, green1 here
- void setup() {
- size(screen.width, screen.height);
- background(255);
- }
- void draw() {
- smooth();
- colorCombo1();
- }
void colorCombo1(){
- noStroke();
- rectMode(CENTER);
- fill(red1);
- rect(1*width/46, height/2, 4*width/15, height);
- fill(green1);
- rect(5*width/46, height/2, 4*width/15, height);
- fill(red1);
- rect(15*width/46, height/2, 4*width/15, height);
- fill(green1);
- rect(19*width/46, height/2, 4*width/15, height);
- fill(red1);
- rect(29*width/46, height/2, 4*width/15, height);
- fill(green1);
- rect(33*width/46, height/2, 4*width/15, height);
- fill(red1);
- rect(43*width/46, height/2, 4*width/15, height);
- }
So what I want to here is blend the different overlapping sections in the additive mode to mimic light. Do you have any ideas on how to do that? I'm a total newbie so any help is appreciated. Thanks!