Skip to content

Commit 1f47afa

Browse files
committed
Handle a case where decimal precision causes an out-of-range exception
1 parent c6a3c5b commit 1f47afa

File tree

1 file changed

+3
-3
lines changed
  • src/MischiefCollective/ColorJizz/Formats

1 file changed

+3
-3
lines changed

src/MischiefCollective/ColorJizz/Formats/HSV.php

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -113,9 +113,9 @@ public function toRGB()
113113
}
114114
}
115115

116-
$red = $var_r * 255;
117-
$green = $var_g * 255;
118-
$blue = $var_b * 255;
116+
$red = round($var_r * 255);
117+
$green = round($var_g * 255);
118+
$blue = round($var_b * 255);
119119
}
120120
return new RGB($red, $green, $blue);
121121
}

0 commit comments

Comments
 (0)