Beschreibung
Fahre horizontal über das Bild. Wenn sich die die CMY Farben überlagern werden sie zu RGB.
Codefunction setup() {
createCanvas(600, 600);
noStroke();
}function draw() {
blendMode(BLEND);
background("white"); blendMode(MULTIPLY);
factor = map(mouseX, 0, width, -0.5, 0.5);
push();
translate(width/2, height/2);
fill("cyan");
triangle(100,100 , height * factor, 0, height/2, 0);
pop();
push();
translate(width/2, height/2);
rotate(2 * PI * 0.5/3);
fill("cyan");
triangle(100,100 , height * factor, 0, height/2, 0);
pop();
//
push();
translate(width/2, height/2);
rotate(2 * PI * 1/3);
fill("magenta");
triangle(100,100 , height * factor, 0, height/2, 0);
pop();
push();
translate(width/2, height/2);
rotate(2 * PI * 1.5/3);
fill("magenta");
triangle(100,100 , height * factor, 0, height/2, 0);
pop();
//
push();
translate(width/2, height/2);
rotate(2 * PI * 2/3);
fill("yellow");
triangle(100,100 , height * factor, 0, height/2, 0);
pop();
push();
translate(width/2, height/2);
rotate(2 * PI * 2.5/3);
fill("yellow");
triangle(100,100 , height * factor, 0, height/2, 0);
pop();
}