xxxxxxxxxx
function setup() {
createCanvas(500, 500);
background(255);
colorMode(HSB,360,100,100);
}
function draw() {
// background(0,0,95);
const sat = 100;
const bright = 100;
noStroke();
randomSeed(23456);
let diameter = 20;
let scale = 23;
let n = frameCount;
for(i = 1;i<100;i++){
p = goldenPoint(i,scale);
var hue = (random(360)+n)%360;
fill(hue,sat,bright);
//funky!
//let s = 1.0 + 0.35*(sin( n));
let s = 1.0 + 0.35*sin( 10.0* i);
diameter *= s;
ellipse(p.x, p.y, diameter, diameter);
}
//saveCanvas();
//noLoop();
// frameRate(10);
}
function goldenPoint( n, s){
let theta = 2.39996*n;
let r=sqrt(n)*s;
p = createVector(r*sin(theta),r*cos(theta));
p.add(width*0.5,height*0.5);
return p;
}