html, body {
margin: 0;
padding: 0;
box-sizing: border-box;
}
body {
background: #292a33;
overflow: hidden;
}
function setup() {
createCanvas(windowWidth, windowHeight);
background(0);
loadPixels();
for (let y = 0; y < height; y++) {
for (let x = 0; x < width; x++) {
const c = [(x / width) * 255, (y / height) * 255, 0];
setPixel(x, y, c);
}
}
updatePixels();
}
function setPixel(x, y, c) {
const i = (y * width + x) * 4;
pixels[i + 0] = c[0];
pixels[i + 1] = c[1];
pixels[i + 2] = c[2];
}
This Pen doesn't use any external CSS resources.