<canvas width="600" height="400"> </canvas>
<script>
var pantalla = document.querySelector("canvas");
var pincel = pantalla.getContext("2d");
pincel.fillStyle = "lightgrey" //propiedad
pincel.fillRect(0,0,600,400); //funcion
pincel.fillStyle = "yellow"
pincel.fillRect(0,0,600,120);
pincel.fillStyle ="blue";
pincel.fillRect (0,121,600,120);
pincel.fillStyle ="red";
pincel.fillRect (0,241,600,160);
</script>