xxxxxxxxxx
15
function setup() {
createCanvas(720, 720);
noCursor();
colorMode(HSB, 360, 100, 100); // hue, saturation, brightness
rectMode(CENTER); // rectangle grows from centrepoint, not edge
noStroke(); // no stroke on the rect
}
function draw() {
background(mouseY / 2, 100, 100); // bg fill set by mouseY
fill(360 - mouseY / 2, 100, 100); // square fill set by mouseY
rect(360, 360, mouseX + 1, mouseX + 1); // square size set by mouseX
}