diff --git a/.circleci/config.yml b/.circleci/config.yml index dc51d3d..4770cf1 100644 --- a/.circleci/config.yml +++ b/.circleci/config.yml @@ -48,4 +48,4 @@ workflows: - unittest: matrix: parameters: - php-version: ["8.1", "8.0"] + php-version: ["8.1", "8.0", "5.6"] diff --git a/src/BaseColor.php b/src/BaseColor.php index feed072..c0e931d 100644 --- a/src/BaseColor.php +++ b/src/BaseColor.php @@ -4,17 +4,17 @@ class BaseColor { const COLOR_ROUNDING_COEFF = 0x33; - private $r; - private $g; - private $b; - private $a; + public $r; + public $g; + public $b; + public $a; function __construct($r = null, $g = null, $b = null, $a = null) { - $this->r = $r ?? 0; - $this->g = $g ?? 0; - $this->b = $b ?? 0; - $this->a = $a ?? 0; + $this->r = $r ? $r : 0; + $this->g = $g ? $g : 0; + $this->b = $b ? $b : 0; + $this->a = $a ? $a : 0; } function getClone() @@ -58,7 +58,7 @@ function toArray() ]; } - function toString() + protected function toString() { return join(',', $this->toArray()); } @@ -94,12 +94,7 @@ function toGd($image, $toAlpha = null) $this->a ); } else { - return imagecolorallocate( - $oGd, - $this->r, - $this->g, - $this->b - ); + return imagecolorallocate($oGd, $this->r, $this->g, $this->b); } } }