Allow for null value when setting colour values

This commit is contained in:
MarkBaker 2020-10-30 11:30:28 +01:00
parent 7b750e3bf5
commit 6966c2fed3
1 changed files with 4 additions and 4 deletions

View File

@ -150,9 +150,9 @@ class Color extends Supervisor
*
* @return $this
*/
public function setARGB(string $colorValue)
public function setARGB(?string $colorValue)
{
if ($colorValue == '') {
if ($colorValue === '' || $colorValue === null) {
$colorValue = self::COLOR_BLACK;
} elseif (!$this->validateARGB($colorValue)) {
return $this;
@ -195,9 +195,9 @@ class Color extends Supervisor
*
* @return $this
*/
public function setRGB(string $colorValue)
public function setRGB(?string $colorValue)
{
if ($colorValue == '') {
if ($colorValue === '' || $colorValue === null) {
$colorValue = '000000';
} elseif (!$this->validateRGB($colorValue)) {
return $this;