<canvas width="600" height="400"></canvas>
<script>
function desenhaEsquadro(xa, ya, xb,yb, xc, yc, cor){
var tela = document.querySelector('canvas');
var pincel = tela.getContext('2d');
pincel.fillStyle="black";
pincel.beginPath();
pincel.moveTo(xa, ya);
pincel.lineTo(xb, yb);
pincel.lineTo(xc, yc);
pincel.fill();
}
desenhaEsquadro (50,50,50,400,400,400,'black');
desenhaEsquadro (100,175,100,350,275,350,'white');
</script>