Allow for null value when setting colour values
This commit is contained in:
parent
7b750e3bf5
commit
6966c2fed3
|
|
@ -150,9 +150,9 @@ class Color extends Supervisor
|
||||||
*
|
*
|
||||||
* @return $this
|
* @return $this
|
||||||
*/
|
*/
|
||||||
public function setARGB(string $colorValue)
|
public function setARGB(?string $colorValue)
|
||||||
{
|
{
|
||||||
if ($colorValue == '') {
|
if ($colorValue === '' || $colorValue === null) {
|
||||||
$colorValue = self::COLOR_BLACK;
|
$colorValue = self::COLOR_BLACK;
|
||||||
} elseif (!$this->validateARGB($colorValue)) {
|
} elseif (!$this->validateARGB($colorValue)) {
|
||||||
return $this;
|
return $this;
|
||||||
|
|
@ -195,9 +195,9 @@ class Color extends Supervisor
|
||||||
*
|
*
|
||||||
* @return $this
|
* @return $this
|
||||||
*/
|
*/
|
||||||
public function setRGB(string $colorValue)
|
public function setRGB(?string $colorValue)
|
||||||
{
|
{
|
||||||
if ($colorValue == '') {
|
if ($colorValue === '' || $colorValue === null) {
|
||||||
$colorValue = '000000';
|
$colorValue = '000000';
|
||||||
} elseif (!$this->validateRGB($colorValue)) {
|
} elseif (!$this->validateRGB($colorValue)) {
|
||||||
return $this;
|
return $this;
|
||||||
|
|
|
||||||
Loading…
Reference in New Issue