]> _ Git - cubist_util.git/commitdiff
done #4666 @0.5
authorVincent Vanwaelscappel <vincent@cubedesigners.com>
Mon, 20 Dec 2021 17:19:37 +0000 (18:19 +0100)
committerVincent Vanwaelscappel <vincent@cubedesigners.com>
Mon, 20 Dec 2021 17:19:37 +0000 (18:19 +0100)
src/Graphics/Color.php

index 78124805b10290b56aec7bc1ebb6e371c462c6b0..4dd77dcefb1b87a05e7d8f29e57875afec4cd918 100644 (file)
@@ -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;