mirror of
https://github.com/pmmp/PocketMine-MP.git
synced 2025-05-13 01:09: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 count;
|
||||||
|
use function intdiv;
|
||||||
|
|
||||||
class Color{
|
class Color{
|
||||||
|
|
||||||
@ -99,7 +100,7 @@ class Color{
|
|||||||
$b += $color->b;
|
$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