mirror of
https://github.com/pmmp/PocketMine-MP.git
synced 2025-05-12 16:59:44 +00:00
Color: make use of intdiv()
This commit is contained in:
parent
a125980ada
commit
9ed13bf112
@ -26,6 +26,7 @@ namespace pocketmine\utils;
|
||||
|
||||
|
||||
use function count;
|
||||
use function intdiv;
|
||||
|
||||
class Color{
|
||||
|
||||
@ -99,7 +100,7 @@ class Color{
|
||||
$b += $color->b;
|
||||
}
|
||||
|
||||
return new Color((int) ($r / $count), (int) ($g / $count), (int) ($b / $count), (int) ($a / $count));
|
||||
return new Color(intdiv($r, $count), intdiv($g, $count), intdiv($b, $count), intdiv($a, $count));
|
||||
}
|
||||
|
||||
/**
|
||||
|
Loading…
x
Reference in New Issue
Block a user