Skip to content

Commit

Permalink
Fix #19 Close #20 Implicit int conversion warning on PHP8.1 (#21)
Browse files Browse the repository at this point in the history
  • Loading branch information
mistic100 authored Jan 16, 2022
1 parent c2012a6 commit 662257f
Showing 1 changed file with 3 additions and 3 deletions.
6 changes: 3 additions & 3 deletions src/RandomColor.php
Original file line number Diff line number Diff line change
Expand Up @@ -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;
}
}
Expand Down Expand Up @@ -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);
}
}

Expand Down Expand Up @@ -387,4 +387,4 @@ static public function hsv2rgb($hsv)
'h' => array(283,334),
's' => array(20,100)
)
);
);

0 comments on commit 662257f

Please sign in to comment.