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