From 3e99f734133905e9ba0cf4fbb98ef417743d4af0 Mon Sep 17 00:00:00 2001 From: Vincent Vanwaelscappel Date: Mon, 20 Dec 2021 18:19:37 +0100 Subject: [PATCH] done #4666 @0.5 --- src/Graphics/Color.php | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) diff --git a/src/Graphics/Color.php b/src/Graphics/Color.php index 7812480..4dd77dc 100644 --- a/src/Graphics/Color.php +++ b/src/Graphics/Color.php @@ -82,9 +82,12 @@ class Color protected function _parseString($input) { $input = ltrim($input, '#'); + if (!$input) { + $input = 'transparent'; + } $c = array('alpha' => 'ff', 'red' => 'ff', 'green' => 'ff', 'blue' => 'ff'); if ($input === 'transparent') { - $this->_alpha=0; + $this->_alpha = 0; } else if (preg_match('/rgba?\(\s*(\d+)\s*,\s*(\d+)\s*,\s*(\d+)\s*(,\s*([0-9.]+)\s*)?\)/', $input, $matches)) { $this->_red = (int)$matches[1] / self::NORM; $this->_green = (int)$matches[2] / self::NORM; -- 2.39.5