xxxxxxxxxx
// Exercise 2: Zoé Arseneau
// The abstract shapes go from a monotone black and white pallet to a bright, colourful one once you move your cursor.
function setup() {
createCanvas(windowWidth, windowHeight);
}
function draw() {
//black and white
if (mouseX < windowWidth/2){
background (175);
//triangle
fill (0);
triangle (590, 420, 618, 370, 646, 420);
//double circles
fill (0);
ellipse(130, 400, 75, 75);
fill (255);
noStroke();
ellipse(155, 415, 50, 50);
//quad
quad(360, 300, 335, 300, 330, 275, 410, 250);
//curve
noFill();
stroke(255, 102, 0);
stroke(0, 0, 0);
strokeCap(SQUARE);
strokeWeight(4);
bezier(650, 150, 600, 160, 650, 195, 590, 215);
strokeWeight(2);
bezier(645, 140, 595, 150, 645, 185, 585, 205);
//pacman
arc(150, 150, 80, 80, 0, PI + QUARTER_PI, PIE);
}
//colour
else {
let lightGreen = color(199, 216, 207);
let green = color(63, 149, 139);
let pink = color(227, 200, 194);
let yellow = color(239, 202, 99);
let purple = color(61, 27, 155);
background (lightGreen);
//triangle
noStroke();
fill (green);
triangle (590, 420, 618, 370, 646, 420);
//double circles
fill (yellow);
ellipse(130, 400, 75, 75);
fill (pink);
noStroke();
ellipse(155, 415, 50, 50);
//quad
fill(purple);
quad(360, 300, 335, 300, 330, 275, 410, 250);
//curve
noFill();
stroke(yellow);
strokeCap(SQUARE);
strokeWeight(4);
bezier(650, 150, 600, 160, 650, 195, 590, 215);
stroke(purple);
strokeWeight(2);
bezier(645, 140, 595, 150, 645, 185, 585, 205);
//pacman
stroke(green);
arc(150, 150, 80, 80, 0, PI + QUARTER_PI, PIE);
}
}