From a125980ada8566f991aa2ea4f0bd02a4efba9cc7 Mon Sep 17 00:00:00 2001 From: "Dylan K. Taylor" Date: Thu, 4 Jul 2019 18:00:37 +0100 Subject: [PATCH] utils: Color is now immutable as is always the case with mutability, allowing this creates lots of complications that aren't worth the hassle. --- changelogs/4.0-snapshot.md | 4 ++++ src/pocketmine/utils/Color.php | 36 ---------------------------------- 2 files changed, 4 insertions(+), 36 deletions(-) diff --git a/changelogs/4.0-snapshot.md b/changelogs/4.0-snapshot.md index 8bd9fe7bc..2e23e8c91 100644 --- a/changelogs/4.0-snapshot.md +++ b/changelogs/4.0-snapshot.md @@ -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()` diff --git a/src/pocketmine/utils/Color.php b/src/pocketmine/utils/Color.php index c860d0521..acb30b6fb 100644 --- a/src/pocketmine/utils/Color.php +++ b/src/pocketmine/utils/Color.php @@ -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. *