xxxxxxxxxx
32
let w = 50;
function setup() {
createCanvas(1500, 3000);
noStroke();
for (i = 0; i < width; i += w) {
for (j = 0; j < height; j += w) {
if (int(random(100)) % 2 == 0) {
fill(randomColor());
triangle(i, j, i + w, j, i + w, j + w);
fill(randomColor());
triangle(i, j, i, j + w, i + w, j + w);
} else {
fill(randomColor());
triangle(i+w, j, i + w, j+w, i, j + w);
fill(randomColor());
triangle(i+w, j, i, j, i, j + w);
}
}
}
//saveCanvas('2','png');
}
function randomColor(){
r = random(55,255);
//c = color(random(150,220),random(90,150),random(25));
c = color(r,r,random(10));
return c;
}
function draw() {}