From 64ea378f191516b1e995a0bb71bb50a74dcb18a3 Mon Sep 17 00:00:00 2001 From: Buffele Date: Thu, 19 Dec 2024 21:49:42 -0700 Subject: [PATCH] EndroidQrCodeProvider: allow transparent for color --- lib/Providers/Qr/EndroidQrCodeProvider.php | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/lib/Providers/Qr/EndroidQrCodeProvider.php b/lib/Providers/Qr/EndroidQrCodeProvider.php index a544cb6..fb5d3d4 100755 --- a/lib/Providers/Qr/EndroidQrCodeProvider.php +++ b/lib/Providers/Qr/EndroidQrCodeProvider.php @@ -82,6 +82,10 @@ protected function qrCodeInstance(string $qrText, int $size): QrCode private function handleColor(string $color): Color|array { + if ($color === 'transparent') { + return $this->endroid4 ? new Color(255, 255, 255, 127) : array('r' => 255, 'g' => 255, 'b' => 255, 'a' => 127); + } + $split = str_split($color, 2); $r = hexdec($split[0]); $g = hexdec($split[1]);