xxxxxxxxxx
38
//let gb = 0;
function setup() {
createCanvas(100, 100);
background("red");
myImage = createImage(width,height);
//for (i = 0; i < 100; i++) {
//for (j = 0; j < 100; j++) {
//let colorr = map(i,0,100,255,255)
//let colorg = map(i,0,100,0,255)
//let colorb = map(i,0,100,0,255)
//stroke(255, gb, gb);
//stroke(random(gb, 255));
//point(i, j);
// }
// }
//gb++
}
function draw() {
myImage.loadPixels();
pixelDensity(1);
//console.log(pixels.length);
for (let i = 0; i < myImage.pixels.length; i += 4) {
//red
myImage.pixels[i] = 255;
//blue
myImage.pixels[i + 1]++;
//green
myImage.pixels[i + 2]++;
//alpha
myImage.pixels[i + 3] = 255;
}
myImage.updatePixels();
image(myImage,0,0);
}