xxxxxxxxxx
23
function setup() {
createCanvas(400, 400);
colorMode(HSB);
noStroke();
}
function draw() {
let leftHue = map(mouseX, 0, width, 0, 90);
fill(leftHue, 100, 100);
rect(0, 0, width/4, height);
fill(360 - leftHue, 100, 100);
rect(width/4, 0, width/4, height);
fill(180 + leftHue, 100, 100);
rect(2*width/4, 0, width/4, height);
fill(180 - leftHue , 100, 100);
rect(3*width/4, 0, width/4, height);
// for (let i = 0; i < width; i +=1) {
// let hueColor = map(i, 0, width, 0, 360);
// stroke(hueColor, 100, 100);
// line(i, 0, i, height);
// }
}