From 62192219833e108222c7ad9dd7be5d35899d8e47 Mon Sep 17 00:00:00 2001 From: ppp0 Date: Tue, 13 Dec 2022 16:37:38 +0100 Subject: [PATCH] Fix casting float to int but do not round (messes up tests) --- lessc.inc.php | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/lessc.inc.php b/lessc.inc.php index f5cc5941..1de460b4 100644 --- a/lessc.inc.php +++ b/lessc.inc.php @@ -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);