xxxxxxxxxx
33
function setup() {
createCanvas(500, 500);
angleMode(DEGREES);
colorMode(HSB, 360);
noStroke();
}
function draw() {
background(0);
translate(width / 2, height / 2);
circles();
}
function circles(){
for (i = 0; i < 360; i += 10){
let angle = i;
// angle += frameCount;
let x = map(cos(angle), 0, 1, 0, 150);
let y = map(sin(angle), 0, 1, 0, 150);
let sat = 100;
if(mouseIsPressed){
sat = map(cos(i - 5 * frameCount), -1, 1, 0, 360);
}
fill(i, sat, 360);
circle(x, y, 60);
}
}