xxxxxxxxxx
55
function setup() {
createCanvas(800, 800);
background(20);
let nc = 10;
let cs = width / nc;
noFill();
stroke(220);
let cs2 = cs / 2;
for (let y = cs2; y < height; y += cs) {
for (let x = cs2; x < width; x += cs) {
circle(x,y,cs-8);
}
}
imageMode(CENTER);
for (let _ = 0; _ < 10; _++) {
let w = 40;
let g = createGraphics(w, height*2);
g.background(0);
g.stroke(220);
g.noFill();
let _nc = int(random(2,8));
let _cs = w/_nc;
let _cs2 = _cs/2;
for (let y = _cs2; y < g.height; y += _cs) {
let col = lerpColor(color(220), color(0,220,0), map(y, _cs2, g.height, 0.0, 1.0))
g.stroke(col)
for (let x = _cs2; x < g.width; x += _cs) {
g.circle(x,y,_cs-2);
}
}
push();
translate(width/2,height/2);
rotate(random(TWO_PI));
translate(random(-width/4,width/4), random(-height/4,height/4));
image(g, 0, 0);
pop();
}
fill(0);
noStroke();
rect(0,0,width,20);
rect(0,0,20,height);
rect(width-20,0,20,height);
rect(0,height-20,width,20);
}
function draw() {
// background(220);
}