xxxxxxxxxx
33
// create a loop that creates an array of rectangles that have their color change gradually from black to white. A single variable will control number of rectangles drawn
var noiseVal = 0;
function setup() {
createCanvas(800, 300);
}
function draw() {
// rect propterties
noStroke();
var rectWidth = 50;
for (var i = 0; i < width/rectWidth; i = i+1) {
var noiseVal = noise(255) + i * 15;
fill(noiseVal);
rect(
i * rectWidth,
i / rectWidth,
rectWidth,
height
);
}
}