mirror of
https://github.com/pmmp/PocketMine-MP.git
synced 2025-10-18 04:00:29 +00:00
utils: Color is now immutable
as is always the case with mutability, allowing this creates lots of complications that aren't worth the hassle.
This commit is contained in:
@@ -53,15 +53,6 @@ class Color{
|
||||
return $this->a;
|
||||
}
|
||||
|
||||
/**
|
||||
* Sets the alpha (opacity) value of this colour, lower = more transparent
|
||||
*
|
||||
* @param int $a
|
||||
*/
|
||||
public function setA(int $a) : void{
|
||||
$this->a = $a & 0xff;
|
||||
}
|
||||
|
||||
/**
|
||||
* Retuns the red value of this colour.
|
||||
* @return int
|
||||
@@ -70,15 +61,6 @@ class Color{
|
||||
return $this->r;
|
||||
}
|
||||
|
||||
/**
|
||||
* Sets the red value of this colour.
|
||||
*
|
||||
* @param int $r
|
||||
*/
|
||||
public function setR(int $r) : void{
|
||||
$this->r = $r & 0xff;
|
||||
}
|
||||
|
||||
/**
|
||||
* Returns the green value of this colour.
|
||||
* @return int
|
||||
@@ -87,15 +69,6 @@ class Color{
|
||||
return $this->g;
|
||||
}
|
||||
|
||||
/**
|
||||
* Sets the green value of this colour.
|
||||
*
|
||||
* @param int $g
|
||||
*/
|
||||
public function setG(int $g) : void{
|
||||
$this->g = $g & 0xff;
|
||||
}
|
||||
|
||||
/**
|
||||
* Returns the blue value of this colour.
|
||||
* @return int
|
||||
@@ -104,15 +77,6 @@ class Color{
|
||||
return $this->b;
|
||||
}
|
||||
|
||||
/**
|
||||
* Sets the blue value of this colour.
|
||||
*
|
||||
* @param int $b
|
||||
*/
|
||||
public function setB(int $b) : void{
|
||||
$this->b = $b & 0xff;
|
||||
}
|
||||
|
||||
/**
|
||||
* Mixes the supplied list of colours together to produce a result colour.
|
||||
*
|
||||
|
Reference in New Issue
Block a user