let rainbow=['#64A23B','#A2413B','#3BA280','#3B84A2','#623BA2'];
let fullSpectrum=['#64A23B','#A2413B','#3BA280','#3B84A2','#623BA2'];
let warmSpectrum=['#900C3F','#FAA040','#FC6486','#FF9A00','#C11418'];
let coolSpectrum=['#3544FE','#B600FF','#7F4FE4','#815CF9','#2D9EF6'];
let grassySpectrum=['#5EF62D','#B7F95C','#098C07','#EAFF36','#72FF81'];
let darkSpectrum=['#464141','#7C7C7C','#A4A4A4','#988E8E','#8E8F98'];
let lightSpectrum=['#FFE5E5','#FFF9F9','#F5FDEE','#F4FCFB','#F8F4FC'];
let baseArray = [darkSpectrum, lightSpectrum];
let spectrumArray = [rainbow,fullSpectrum,warmSpectrum,coolSpectrum,grassySpectrum];
createCanvas(600,600, WEBGL);
planeSize = random(100,600);
planeDivider = int(random(2,15));
pegSize = planeSize/planeDivider;
palette = baseArray[int(random(0,baseArray.length))];
palette2 = spectrumArray[int(random(0,spectrumArray.length))];
palette2 = baseArray[int(random(0,baseArray.length))];
palette = spectrumArray[int(random(0,spectrumArray.length))];
lowRange = random(25,50);
highRange = lowRange + random(25,50);
translate(-((planeSize-pegSize)/2),-((planeSize-pegSize)/2),0);
for (let i=0;i<planeDivider;i++)
for (let i=0; i<planeDivider; i++){
pegHeight = random(lowRange,highRange);
fill(palette[int(random(0,palette.length))]);
box(pegSize, pegSize, pegHeight);
translate(0,0,pegHeight*.75);
fill(palette2[int(random(0,palette2.length))]);
box(pegSize*pegSM1,pegSize*pegSM1,pegHeight*.25);
translate(0,0,pegHeight*.25);
fill(palette[int(random(0,palette.length))]);
box(pegSize*pegSM1,pegSize*pegSM1,pegHeight*.25);
translate(0,0,-pegHeight*1);
translate(0,0,-pegHeight*.75);
translate(0,0,-pegHeight*.75);
fill(palette2[int(random(0,palette2.length))]);
box(pegSize*pegSM1,pegSize*pegSM1,pegHeight*.25);
translate(0,0,-pegHeight*.25);
fill(palette[int(random(0,palette.length))]);
box(pegSize*pegSM1,pegSize*pegSM1,pegHeight*.25);
translate(0,0,pegHeight*1);
translate(0,0,pegHeight*.75);
translate(0,0,pegHeight*1.5);
fill(palette2[int(random(0,palette2.length))]);
box(pegSize*pegSM2,pegSize*pegSM2,pegHeight*.25);
translate(0,0,pegHeight*.25);
fill(palette[int(random(0,palette.length))]);
box(pegSize*pegSM2,pegSize*pegSM2,pegHeight*.25);
translate(0,0,-pegHeight*1.75);
translate(0,0,-pegHeight*1.5);
translate(0,0,-pegHeight*1.5);
fill(palette2[int(random(0,palette2.length))]);
box(pegSize*pegSM2,pegSize*pegSM2,pegHeight*.25);
translate(0,0,-pegHeight*.25);
fill(palette[int(random(0,palette.length))]);
box(pegSize*pegSM2,pegSize*pegSM2,pegHeight*.25);
translate(0,0,pegHeight*1.75);
translate(0,0,pegHeight*1.5);
translate(0,0,pegHeight*2.25);
fill(palette2[int(random(0,palette2.length))]);
box(pegSize*pegSM1,pegSize*pegSM1,pegHeight*.25);
translate(0,0,pegHeight*.25);
fill(palette[int(random(0,palette.length))]);
box(pegSize*pegSM1,pegSize*pegSM1,pegHeight*.25);
translate(0,0,-pegHeight*2.5);
translate(0,0,-pegHeight*2.25);
translate(0,0,-pegHeight*2.25);
fill(palette2[int(random(0,palette2.length))]);
box(pegSize*pegSM1,pegSize*pegSM1,pegHeight*.25);
translate(0,0,-pegHeight*.25);
fill(palette[int(random(0,palette.length))]);
box(pegSize*pegSM1,pegSize*pegSM1,pegHeight*.25);
translate(0,0,pegHeight*2.5);
translate(0,0,pegHeight*2.25);
translate(0,0,pegHeight*4);
fill(palette2[int(random(0,palette2.length))]);
box(pegSize*pegSM2,pegSize*pegSM2,pegHeight*.25);
translate(0,0,pegHeight*.25);
fill(palette[int(random(0,palette.length))]);
box(pegSize*pegSM2,pegSize*pegSM2,pegHeight*.25);
translate(0,0,-pegHeight*4.25);
translate(0,0,-pegHeight*4);
translate(0,0,-pegHeight*4);
fill(palette2[int(random(0,palette2.length))]);
box(pegSize*pegSM2,pegSize*pegSM2,pegHeight*.25);
translate(0,0,-pegHeight*.25);
fill(palette[int(random(0,palette.length))]);
box(pegSize*pegSM2,pegSize*pegSM2,pegHeight*.25);
translate(0,0,pegHeight*4.25);
translate(0,0,pegHeight*4);
translate(0,0,pegHeight*5);
fill(palette2[int(random(0,palette2.length))]);
box(pegSize*pegSM1,pegSize*pegSM1,pegHeight*.25);
translate(0,0,pegHeight*.25);
fill(palette[int(random(0,palette.length))]);
box(pegSize*pegSM1,pegSize*pegSM1,pegHeight*.25);
translate(0,0,-pegHeight*5.25);
translate(0,0,-pegHeight*5);
translate(0,0,-pegHeight*5);
fill(palette2[int(random(0,palette2.length))]);
box(pegSize*pegSM1,pegSize*pegSM1,pegHeight*.25);
translate(0,0,-pegHeight*.25);
fill(palette[int(random(0,palette.length))]);
box(pegSize*pegSM1,pegSize*pegSM1,pegHeight*.25);
translate(0,0,pegHeight*5.25);
translate(0,0,pegHeight*5);