// get canvas and context
var myCanvas = document.getElementById("myCanvas");
var myContext = myCanvas.getContext("2d");
// Draw some rectangles with different color values
myContext.fillStyle = "red";
myContext.fillRect(5, 5, 200, 200);
myContext.fillStyle = "rgba(0,50,200,0.5)";
myContext.fillRect(55, 55, 200, 200);
myContext.fillStyle = "rgba(0,255,10,0.5)";
myContext.fillRect(100, 100, 200, 200);
myContext.stroke();