p5((sketch) => {
let inc = 0.01;
sketch.setup = function () {
sketch.createCanvas(200, 200);
};
sketch.draw = function () {
let yoff = 0;
sketch.loadPixels();
for (let y = 0; y < sketch.height; y++) {
let xoff = 0;
for (let x = 0; x < sketch.width; x++) {
let index = (x + y * sketch.width) * 4;
let r = sketch.noise(xoff, yoff) * 255;
sketch.pixels[index + 0] = r;
sketch.pixels[index + 1] = r;
sketch.pixels[index + 2] = r;
sketch.pixels[index + 3] = 255;
xoff += inc;
}
yoff += inc;
}
sketch.updatePixels();
};
})