mirror of
https://github.com/PHPOffice/PhpSpreadsheet.git
synced 2026-08-31 12:40:00 +00:00
Allow for null value when setting colour values
This commit is contained in:
@@ -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;
|
||||
|
||||
Reference in New Issue
Block a user