<canvas width="600" height="400"></canvas>
<script>
function desenhaEsquadro(xa1, ya1, xc1, yc1, cor1, xa2, ya2, xc2, yc2, cor2, ) {
var tela = document.querySelector('canvas');
var pincel = tela.getContext('2d');
pincel.fillStyle = cor1;
pincel.beginPath();
pincel.moveTo(xa1, ya1);
pincel.lineTo(xa1, yc1);
pincel.lineTo(xc1, yc1);
pincel.fill();
pincel.fillStyle = cor2;
pincel.beginPath();
pincel.moveTo(xa2, ya2);
pincel.lineTo(xa2, yc2);
pincel.lineTo(xc2, yc2);
pincel.fill();
}
desenhaEsquadro(50, 50, 400, 400, 'black', 100, 175, 275, 350, 'white');
</script>