xxxxxxxxxx
35
let a = 0 // this angle helps to rotate all the circles in a swing!
function setup() {
createCanvas(400, 400);
colorMode(HSB);
frameRate(120);
//setting angle mode to degrees
//to aid in positioning of circles
angleMode(DEGREES);
}
function draw() {
background (0)
noStroke();
//loop steps through 36 times drawing
//a circle with a separate hue each time
translate(320,320)
for (let i = 0;i<36;i++){
rotate(a)
//determines position of circles
x = 200 + 100*cos(i*10);
y = 200 + 100*sin(i*10);
fill(i*10,100,100);
circle(x,y,50);
a += 0.005
}
}
function mousePressed() {
saveGif('mySketch.gif', 10)
}