From 662257f8641632bc4297868c6aff01640eb52966 Mon Sep 17 00:00:00 2001 From: Damien Sorel Date: Sun, 16 Jan 2022 15:18:33 +0100 Subject: [PATCH] Fix #19 Close #20 Implicit int conversion warning on PHP8.1 (#21) --- src/RandomColor.php | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/src/RandomColor.php b/src/RandomColor.php index b05e0ef..33cf277 100644 --- a/src/RandomColor.php +++ b/src/RandomColor.php @@ -157,7 +157,7 @@ static private function _pickBrightness($h, $s, $options) break; case 'light': - $range[0] = ($range[1] + $range[0]) / 2; + $range[0] = round(($range[1] + $range[0]) / 2); break; } } @@ -228,7 +228,7 @@ static private function _getMinimumBrightness($h, $s) { $m = ($v2 - $v1) / ($s2 - $s1); $b = $v1 - $m * $s1; - return $m * $s + $b; + return round($m * $s + $b); } } @@ -387,4 +387,4 @@ static public function hsv2rgb($hsv) 'h' => array(283,334), 's' => array(20,100) ) - ); \ No newline at end of file + );