xxxxxxxxxx
function setup() {
//Set canvas size
createCanvas(500, 500);
//Set background color
background(255);
noLoop();
}
function draw() {
for (let i = 0; i < 100; i++) {
//Random x position
let x = random(width);
//Random y position
let y = random(height);
//Random size for the circle
let size = random(10, 50);
//Draw a circle with random position and size
//Random color
fill(random(255), random(255), random(255));
noStroke();
ellipse(x, y, size, size);
//Draw a line from the center to the circle
//Random color
stroke(random(255), random(255), random(255));
//Line from the center to circle
line(width / 2, height / 2, x, y);
}
}