From: Vincent Vanwaelscappel Date: Mon, 20 Dec 2021 17:19:37 +0000 (+0100) Subject: done #4666 @0.5 X-Git-Url: http://git.cubedesigners.com/?a=commitdiff_plain;h=3e99f734133905e9ba0cf4fbb98ef417743d4af0;p=cubist_util.git done #4666 @0.5 --- 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;