mirror of
https://github.com/pmmp/PocketMine-MP.git
synced 2025-04-22 16:51:42 +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:
parent
062e692069
commit
a125980ada
@ -641,6 +641,10 @@ This version features substantial changes to the network system, improving coher
|
||||
- The following API methods have signature changes:
|
||||
- `Internet::simpleCurl()` now requires a `Closure` for its `onSuccess` parameter instead of `callable`.
|
||||
- The following API methods have been removed:
|
||||
- `Color->setA()`
|
||||
- `Color->setR()`
|
||||
- `Color->setG()`
|
||||
- `Color->setB()`
|
||||
- `Color->toABGR()`
|
||||
- `Color->toBGRA()`
|
||||
- `Color::fromABGR()`
|
||||
|
@ -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.
|
||||
*
|
||||
|
Loading…
x
Reference in New Issue
Block a user