nouns image background

This commit is contained in:
Avris 2020-12-01 20:35:23 +01:00
parent 324e057a93
commit 88bb71c73f
2 changed files with 2 additions and 3 deletions

View File

@ -152,9 +152,8 @@ router.get('/nouns/:word.png', async (req, res) => {
const canvas = createCanvas(width, height);
const context = canvas.getContext('2d');
context.fillStyle = '#fff';
context.fillRect(0, 0, width, height);
context.fillStyle = '#000';
const bg = await loadImage('static/bg.png');
context.drawImage(bg, 0, 0, width, height);
context.font = 'bold 64pt Quicksand';
context.fillText(base, width / 2 - context.measureText(base).width / 2, 120);

BIN
static/bg.png Normal file

Binary file not shown.

After

Width:  |  Height:  |  Size: 28 KiB