xxxxxxxxxx
function setup() {
createCanvas(512, 512);
frameRate(30);
colorMode(HSB, 1.0, 1.0, 1.0, 1.0);
}
function drawForm() {
const rmax = width / 2;
const a0 = random() * 4 * TAU;
const x0 = width / 2 + rmax * cos(a0);
const y0 = height / 2 + rmax * sin(a0);
noStroke();
for (let d = 0; d < (TAU * rmax * rmax * 0.4); d++) {
const a = random() * 4 * TAU;
const r = random() * rmax;
const d = r / rmax;
const x = x0 + r * cos(a);
const y = y0 + r * sin(a);
const h = map(d,
0, 1,
20 / 360,
80 / 360);
fill(h,
0.1,
easeOutCubic((1 - d)) * 0.85,
easeOutCirc(1 - d));
circle(x, y, 8);
rectMode(CENTER);
rect(x, y, 6, 6);
}
}
function draw() {
noLoop();
background(210 / 360, 0.5, 0.05);
drawForm();
}