xxxxxxxxxx
37
let s = 1;
function setup() {
createCanvas(400, 400);
colorMode(RGB)
}
function draw() {
background(0);
//changes squares color
let squareHue = map(mouseX, 0, width, 0, 360);
//changes background color
let rectHue = map(mouseY, 0, height, 20, 300);
translate(200, 200);
s = s + 0.2;
if (s > 4) {
s = 1;
}
//background color
fill(rectHue, 90, 150);
rect(-200, -200, 400);
//5 squares color
scale (s);
fill(squareHue, 100, 90);
rect(-60, 40, 25);
rect(30, -60, 25);
rect(-15, -10, 25)
rect(-60, -60, 25);
rect(30, 40, 25);
}