From 11de346da282821b922ad1600c6c0bec95ce6622 Mon Sep 17 00:00:00 2001 From: endroid Date: Fri, 19 Jan 2018 09:53:24 +0000 Subject: [PATCH] Set alpha to 0 when not passed --- src/QrCode.php | 8 ++++++++ 1 file changed, 8 insertions(+) diff --git a/src/QrCode.php b/src/QrCode.php index 93bfa05..30af308 100644 --- a/src/QrCode.php +++ b/src/QrCode.php @@ -98,6 +98,10 @@ public function getMargin(): int public function setForegroundColor(array $foregroundColor): void { + if (!isset($foregroundColor['a'])) { + $foregroundColor['a'] = 0; + } + $this->foregroundColor = $foregroundColor; } @@ -108,6 +112,10 @@ public function getForegroundColor(): array public function setBackgroundColor(array $backgroundColor): void { + if (!isset($backgroundColor['a'])) { + $backgroundColor['a'] = 0; + } + $this->backgroundColor = $backgroundColor; }