JSFiddle - React, Tailwind, and code Playground
JavaScript
(n=>{
x=(d=document).body.appendChild(c=d.createElement`canvas`).getContext`2d`;
c.width=2*(c.height=4*(p=Math.pow(2,n)));
for(i=0;i<n;i++){
c=-1;
for(j of[...'0001000001111110022112200221122011111110011121110111111000010000'])
for(x.fillStyle=['#74c460','#6eaa5a','#000'][j],c++,k=0;k<p;)
x.fillRect(c%8*(_=Math.pow(2,i))+_*8,~~(c/8)*_+_*8*k++,_,_)
}
})(4);