<script>
let tela = document.getElementById("canvas");
let pincel = tela.getContext("2d");
let cor = (cor) => {
pincel.fillStyle = cor;
}
cor("green");
pincel.fillRect(0, 0, 600, 400)
cor("yellow");
pincel.beginPath();
pincel.moveTo(50, 200);
pincel.lineTo(300, 40);
pincel.lineTo(300, 370);
pincel.moveTo(200, 0)
pincel.lineTo(0, 200)
pincel.moveTo(550, 200);
pincel.lineTo(300, 40);
pincel.lineTo(300, 370);
pincel.fill();
cor('blue');
pincel.beginPath();
pincel.arc(300, 200, 100, 0, 2 * 3.14);
pincel.fill();
</script>