xxxxxxxxxx
35
//|================================|
//| NOISE |
//|--------------------------------|
//| JAMES MENDEL |
//| jamesmendel.github.io |
//| created: 11.14.2021 |
//|================================|
let sz = 18;
let c_on = 200;
let c_off = 30;
function setup() {
createCanvas(500, 500);
rectMode(CORNERS)
frameRate(5);
strokeWeight(0);
}
function draw() {
background(c_off+5);
//fun grid with added spacing (note rect size, and corner mode)
for(let i = ((width/sz)-sz)/2; i < width; i += width/sz){
for(let j = ((width/sz)-sz)/2; j < height; j += height/sz){
if(random() > 0.5){
fill(c_on);
} else {
fill(c_off);
}
rect(i, j, i+sz, j+sz);
}
}
}