xxxxxxxxxx
20
function setup() {
createCanvas(600, 400);
noStroke();
let div = 2;
let w = width/div;
rectMode(CENTER);
for (let x = w/2; x < width; x += w) {
let c = map(x, 0, width, 0, 255)/255;
let factor = div - 1;
c = round(c * factor) / factor;
console.log(c);
fill(c*255);
rect(x, 0, w, height);
}
}
function draw() {
//background(220);
}