Workshop › Simon Says Colors › Step 2 of 27
Our first drawing: the whole canvas becomes dark navy, so the colored pads will glow on it. Drawing is always two moves: pick a color, then fill a shape with it.
```js
ctx.fillStyle = '#0f172a'
ctx.fillRect(0, 0, canvas.width, canvas.height)
```ctx.fillStyle = '#0f172a' picks the fill color, a dark navy.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 The first pad →