let myArr = [];


function setup() {
  createCanvas (1024,400);
  background(255);
  noLoop();
  
  xPos = 0;
 
  for (let i = 0; i < 256; i++) { 
    myArr.push(i); 

  myArr.reverse();
  myArr = shuffle(myArr);
}
  console.log(myArr);
  myArr = shuffler(myArr);

}

function draw() {
  noStroke();
    for (let i = 0; i < myArr.length; i++) {
        fill(myArr[i], 0, 120);
        rect(xPos,0,width/256,height);
        xPos = xPos+(width/256);
    }

}

function shuffler(array) {
    
  for (let i = array.length - 1; i > 0; i--) { 
      let j = Math.floor(Math.random() * (i + 1)); 
      let temp = array[i]; 
      array[i] = array[j]; 
      array[j] = temp;
  }

  return array;
}
