xxxxxxxxxx
58
let gfx;
function setup() {
createCanvas(600, 600);
gfx = createGraphics(width, height);
let mid_h = width/2;
let max_radius = 100;
background(0);
fill(255);
for (let i = 0; i < 50000; i++) {
let _x = random(width);
let _y = random(mid_h,height);
let _radius = random(5);
let _col = map(_y,mid_h,height,255,0);
gfx.fill(color(_col,_col,_col,128));
gfx.ellipse(_x,_y,_radius,_radius); // grayscale
gfx.fill(color(0,0,_col,255)); // blue
gfx.ellipse(_x,height-_y,_radius,_radius);
}
gfx.stroke(color(128,128,128,128));
gfx.strokeWeight(2);
gfx.line(0,mid_h,width,mid_h);
for (let i = 0; i < 15; i++) {
let start_rad = random(max_radius,max_radius-50);
let min_x = start_rad+2;
let max_x = width - (start_rad+2);
let min_y = start_rad+2;
let max_y = mid_h - (start_rad+2);
let _x = random(min_x,max_x);
let _y = random(min_y,max_y);
let _r = start_rad;
for (let j = 0; j < 10; j++) {
let _col = map(j,0,9,255,0);
gfx.fill(color(_col,_col,_col,128));
gfx.stroke(map(_y,mid_h,height,0,255));
gfx.ellipse(_x,_y,_r,_r);
gfx.fill(color(0,0,_col,128));
gfx.stroke(map(_y,mid_h,height,0,255));
gfx.ellipse(_x,height-_y,_r,_r);
_r -= 10;
}
}
image(gfx,0,0);
}
function draw() {
//background(0);
}