From 4da495a8ccf35868607cd86e422581857b0ce570 Mon Sep 17 00:00:00 2001 From: videogame hacker Date: Mon, 13 Feb 2023 19:41:02 +0000 Subject: [PATCH] Support transparent-bg QR codes --- lib/qr.ts | 2 ++ 1 file changed, 2 insertions(+) diff --git a/lib/qr.ts b/lib/qr.ts index b868097..c881c5d 100644 --- a/lib/qr.ts +++ b/lib/qr.ts @@ -48,6 +48,8 @@ class QrcodeDecoder { } this.gCtx!.clearRect(0, 0, width, height); + this.gCtx!.fillStyle = "#ffffff"; + this.gCtx!.fillRect(0, 0, width, height); this.gCtx!.drawImage(target, 0, 0, width, height); const imageData = this.gCtx!.getImageData(