xxxxxxxxxx
54
function setup() {
createCanvas(500, 700);
rectMode(CENTER);
angleMode(DEGREES);
colorMode(HSB);
}
function draw() {
background(0, 44, 100);
noLoop();
for (let x = 0; x < 6; x++) {
for (let y = 0; y < 7; y++) {
push();
if (random(10) > 3) {
push();
if (random(10) > 6) {
translate(x * 100, y * 100);
if (random(10) > 4) {
scale(2);
}
rotate(90);
gradientA();
} else {
translate(x * 100, (y + 1) * 100);
rotate(180);
gradientA();
}
pop();
}
pop();
}
}
}
function gradientA() {
let img = createImage(100, 100);
img.loadPixels();
for (let i = 0; i < img.width; i++) {
for (let j = 0; j < img.height; j++) {
img.set(i, j, color((i % img.width) * 0.3, 44, 100));
}
}
img.updatePixels();
image(img, 0, 0);
}