Learn by Building Workshop Skills GitHub Türkçe Workshop › Wordle-style Word Guess › Step 2 of 26
Paint the background What we are doing Our first drawing: the whole canvas gets an almost black background.
```js
ctx.fillStyle = '#18181b'
ctx.fillRect(0, 0, canvas.width, canvas.height)
```What it means
ctx.fillStyle = '#18181b' picks the fill color.
ctx.fillRect(x, y, width, height) fills a rectangle. 0, 0 is the top-left corner; canvas.width and
canvas.height (360 and 560) make it cover everything.
Your turn Under const ctx = ..., leave an empty line and write the two lines. Press Run .
Skills: Drawing on a canvas
← The canvas and the pen A function that draws →
All steps The canvas and the pen Paint the background A function that draws A row of five tiles Six rows Draw again and again The typed letters Type with the keyboard Show the letters Backspace Leave shortcuts alone A secret word Right letter, right place Right letter, wrong place Enter sends the guess Colour the guesses Winning and losing A message line Where the keys go Draw the keyboard Tap a key Enter and Delete keys Keys that remember Keep statistics Show the statistics Build it yourself: only real words