Workshop › Memory › Step 2 of 25
Our first drawing: the whole canvas becomes a dark indigo table for the cards. Drawing is always two moves: pick a color, then fill a shape with it.
```js
ctx.fillStyle = '#1e1b4b'
ctx.fillRect(0, 0, canvas.width, canvas.height)
```ctx.fillStyle = '#1e1b4b' picks the fill color, a dark indigo.ctx.fillRect(x, y, width, height) fills a rectangle. 0, 0 is the top-left corner, and canvas.width and
canvas.height (400 and 440) make it cover everything.Leave an empty line under const ctx = ..., write the two lines, then press Run.
Skills: Drawing on a canvas
← Get the canvas and the pen One card →