xxxxxxxxxx
26
var blendModes;
var blendModeIndex;
function setup() {
createCanvas(400, 400);
noStroke();
blendModes = [
BLEND, DARKEST, LIGHTEST, DIFFERENCE, MULTIPLY, EXCLUSION, SCREEN, REPLACE, OVERLAY, HARD_LIGHT, SOFT_LIGHT, DODGE, BURN, ADD
];
blendModeIndex = 0;
}
function mousePressed() {
blendModeIndex = (blendModeIndex + 1) % blendModes.length;
console.log(blendModes[blendModeIndex]);
blendMode(blendModes[blendModeIndex]);
}
function draw() {
background(220);
fill(255, 0, 0);
ellipse(width / 2 - 16, height / 2, 64);
fill(0, 0, 255);
ellipse(width / 2 + 16, height / 2, 64);
}