var canvas = document.createElement(‚canvas‘); canvas.setAttribute(‚width‘,500); canvas.setAttribute(‚height‘,500); document.getElementById(‚canvasDiv‘).appendChild(canvas);
var ctx = canvas.getContext(‚2d‘); ctx.fillStyle = „rgb(200,50,0)“; ctx.fillRect(0, 10, 55, 50);
Vrati polohu a rozmery
bottom height left right top width
ctx.fillStyle = „orange“;
ctx.fillStyle = „#FFA500“;
ctx.fillStyle = „rgb(255,165,0)“;
ctx.fillStyle = „rgba(255,165,0,1)“;