diff --git a/changelogs/4.0-snapshot.md b/changelogs/4.0-snapshot.md index 6aa84f48c..ffac9f138 100644 --- a/changelogs/4.0-snapshot.md +++ b/changelogs/4.0-snapshot.md @@ -769,6 +769,7 @@ This version features substantial changes to the network system, improving coher - `Utils::$online` - `Utils::$os` - The following API methods have signature changes: + - `Color::mix()` now requires the first parameter. Previously, it was possible to pass zero arguments, which would raise an `ArgumentCountError` (not static analysis friendly). - `Internet::simpleCurl()` now requires a `Closure` for its `onSuccess` parameter instead of `callable`. - The following API methods have been removed: - `Color->setA()` diff --git a/src/utils/Color.php b/src/utils/Color.php index 833f15894..12d679a49 100644 --- a/src/utils/Color.php +++ b/src/utils/Color.php @@ -79,15 +79,14 @@ final class Color{ /** * Mixes the supplied list of colours together to produce a result colour. * + * @param Color $color1 * @param Color ...$colors * * @return Color */ - public static function mix(Color ...$colors) : Color{ + public static function mix(Color $color1, Color ...$colors) : Color{ + $colors[] = $color1; $count = count($colors); - if($count < 1){ - throw new \ArgumentCountError("No colors given"); - } $a = $r = $g = $b = 0;