xxxxxxxxxx
20
barcode = [0, 1, 0, 0, 1, 2, 1, 1, 0, 1, 0, 2,0,0,0,1,1,0,2,0,1,0,1,1,1,0];
function setup() {
createCanvas(400, 120);
background("black");
translate(10,0)
for (let i = 0; i < barcode.length; i++) {
if (barcode[i] == 0) {
fill("#6B83C9");
rect(15 * i, 10, 10, 100);
} else if (barcode[i] == 1) {
fill("#0491F7");
rect(15 * i, 10, 10, 100);
}
else if(barcode[i] == 2){
fill("#FF4D4A")
rect(15*i,10,15,100)
}
}
}