Added default alpha param to ColourRGB and ColourHSL.
This commit is contained in:
parent
28634b5db3
commit
66a35f030f
2 changed files with 2 additions and 2 deletions
|
@ -15,7 +15,7 @@ class ColourHSL extends Colour {
|
|||
private int $green;
|
||||
private int $blue;
|
||||
|
||||
public function __construct(float $hue, float $saturation, float $lightness, float $alpha) {
|
||||
public function __construct(float $hue, float $saturation, float $lightness, float $alpha = 1.0) {
|
||||
$this->hue = $hue;
|
||||
$this->saturation = max(0.0, min(1.0, $saturation));
|
||||
$this->lightness = max(0.0, min(1.0, $lightness));
|
||||
|
|
|
@ -11,7 +11,7 @@ class ColourRGB extends Colour {
|
|||
private int $blue;
|
||||
private float $alpha;
|
||||
|
||||
public function __construct(int $red, int $green, int $blue, float $alpha) {
|
||||
public function __construct(int $red, int $green, int $blue, float $alpha = 1.0) {
|
||||
$this->red = max(0, min(255, $red));
|
||||
$this->green = max(0, min(255, $green));
|
||||
$this->blue = max(0, min(255, $blue));
|
||||
|
|
Loading…
Reference in a new issue