xxxxxxxxxx
55
let size = 20;
let zoff;
let cols;
function setup() {
createCanvas(800, 800);
noiseDetail(8,0.25);
background(220);
cols = [
"#000000",
"#333333",
"#666666",
"#999999",
]
zoff = random(0,50000);
// let size = 20;
// loadPixels();
// noStroke();
// for (let y = 0; y < height; y+=size) {
// for (let x = 0; x < width; x+=size) {
// let n = noise(x * 0.01, y * 0.01, zoff * 0.01);
// if (n < 0.25) fill(cols[0]);//set(x,y,color(cols[0]));
// else if (n < 0.5) fill(cols[1]);//set(x,y,color(cols[1]));
// else if (n < 0.75) fill(cols[2]);//set(x,y,color(cols[2]));
// else fill(cols[3]);// set(x,y,color(cols[3]));
// square(x,y,size);
// }
// }
// updatePixels();
// noLoop();
}
function draw() {
// background(220);
noStroke();
for (let y = 0; y < height; y+=size) {
for (let x = 0; x < width; x+=size) {
let n = noise(x * 0.001, y * 0.001, zoff * 0.0001);
if (n < 0.25) fill(cols[0]);//set(x,y,color(cols[0]));
else if (n < 0.5) fill(cols[1]);//set(x,y,color(cols[1]));
else if (n < 0.75) fill(cols[2]);//set(x,y,color(cols[2]));
else fill(cols[3]);// set(x,y,color(cols[3]));
square(x,y,size);
}
}
zoff++;
}