Skip to content

Commit

Permalink
Fix casting float to int but do not round (messes up tests)
Browse files Browse the repository at this point in the history
  • Loading branch information
ppp0 committed Dec 13, 2022
1 parent 3966835 commit 6219221
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion lessc.inc.php
Original file line number Diff line number Diff line change
Expand Up @@ -1669,7 +1669,7 @@ protected function coerceColor($value) {
$width = strlen($colorStr) == 3 ? 16 : 256;

for ($i = 3; $i > 0; $i--) { // 3 2 1
$t = (int) round($num) % (int) round($width);
$t = (int) $num % (int) $width;
$num /= $width;

$c[$i] = $t * (256/$width) + $t * floor(16/$width);
Expand Down

0 comments on commit 6219221

Please sign in to comment.