xxxxxxxxxx
42
var inc = 0.008;
function setup() {
createCanvas(400, 400);
pixelDensity(1);
}
function draw() {
let yoff = 0.03;
loadPixels();
for (let y = 0; y < height; y++) {
let xoff = 3;
for (let x = 0; x < width; x++) {
let index = (x + y * width) * 4;
let r = noise(xoff+frameCount/15, y, frameCount/8) * 255;
pixels[index + 0] = 1
pixels[index + 1] = 96
pixels[index + 2] = 100
pixels[index + 3] = r;
xoff += inc;
}
yoff += inc;
}
updatePixels();
setGradient(color(255, 255, 255, 170), color(1, 96, 100, 255));
}
function setGradient(c1, c2) {
// noprotect
noFill();
for (var y = 0; y < height; y++) {
var inter = map(y, 0, height, 0, 1);
var c = lerpColor(c1, c2, inter);
stroke(c);
line(0, y, width, y);
}
}