xxxxxxxxxx
31
/*
color interaction
*/
function setup() {
createCanvas(400, 400);
noStroke();
}
function draw() {
background(220);
// fill(mouseX, 0, 0);
var r = map(mouseY, 0, height / 2, 255, 0);
fill(r, 100, 100);
ellipse(width / 2, height / 2, width);
// eyes
var s = map(mouseY, 100, 200, 50, 100, true);
var x = map(mouseX, 100, 300, 150, 250, true);
fill(0);
ellipse(x, height / 2, s);
}
function mousePressed() {
save('interaction.png');
}