From 21b171245a6edfbec94ed9ed4699eb61b9fa1cd8 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Thomas=20Lov=C3=A9n?= Date: Thu, 8 Feb 2024 09:18:41 +0100 Subject: [PATCH 1/4] Use fixed colors for qr codes --- src/components/ha-qr-code.ts | 3 +-- 1 file changed, 1 insertion(+), 2 deletions(-) diff --git a/src/components/ha-qr-code.ts b/src/components/ha-qr-code.ts index 47190c180c36..59a90652496a 100644 --- a/src/components/ha-qr-code.ts +++ b/src/components/ha-qr-code.ts @@ -74,8 +74,7 @@ export class HaQrCode extends LitElement { margin: this.margin, maskPattern: this.maskPattern, color: { - light: computedStyles.getPropertyValue("--card-background-color"), - dark: computedStyles.getPropertyValue("--primary-text-color"), + light: #ffffffff, }, }).catch((err) => { this._error = err.message; From c567f20074bf554e3a91cf82d24c4292ba443dc1 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Thomas=20Lov=C3=A9n?= Date: Thu, 8 Feb 2024 09:26:42 +0100 Subject: [PATCH 2/4] Quote --- src/components/ha-qr-code.ts | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/components/ha-qr-code.ts b/src/components/ha-qr-code.ts index 59a90652496a..cde50c36122a 100644 --- a/src/components/ha-qr-code.ts +++ b/src/components/ha-qr-code.ts @@ -74,7 +74,7 @@ export class HaQrCode extends LitElement { margin: this.margin, maskPattern: this.maskPattern, color: { - light: #ffffffff, + light: "#ffffffff", }, }).catch((err) => { this._error = err.message; From edd9cb769d0836a58c81337c6a098c0f9fb700bb Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Thomas=20Lov=C3=A9n?= Date: Thu, 8 Feb 2024 09:31:03 +0100 Subject: [PATCH 3/4] Lint --- src/components/ha-qr-code.ts | 1 - 1 file changed, 1 deletion(-) diff --git a/src/components/ha-qr-code.ts b/src/components/ha-qr-code.ts index cde50c36122a..571451eb41d0 100644 --- a/src/components/ha-qr-code.ts +++ b/src/components/ha-qr-code.ts @@ -64,7 +64,6 @@ export class HaQrCode extends LitElement { changedProperties.has("errorCorrectionLevel") || changedProperties.has("centerImage")) ) { - const computedStyles = getComputedStyle(this); QRCode.toCanvas(canvas, this.data, { errorCorrectionLevel: From 6c59a42dda33217612a166623551572cf4b11d89 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Thomas=20Lov=C3=A9n?= Date: Thu, 8 Feb 2024 09:35:43 +0100 Subject: [PATCH 4/4] More lint. Sure hope this gets squashed... --- src/components/ha-qr-code.ts | 3 +-- 1 file changed, 1 insertion(+), 2 deletions(-) diff --git a/src/components/ha-qr-code.ts b/src/components/ha-qr-code.ts index 571451eb41d0..bf95b70aa0d9 100644 --- a/src/components/ha-qr-code.ts +++ b/src/components/ha-qr-code.ts @@ -64,7 +64,6 @@ export class HaQrCode extends LitElement { changedProperties.has("errorCorrectionLevel") || changedProperties.has("centerImage")) ) { - QRCode.toCanvas(canvas, this.data, { errorCorrectionLevel: this.errorCorrectionLevel || (this.centerImage ? "Q" : "M"), @@ -73,7 +72,7 @@ export class HaQrCode extends LitElement { margin: this.margin, maskPattern: this.maskPattern, color: { - light: "#ffffffff", + light: "#fff", }, }).catch((err) => { this._error = err.message;