From a38861f589c5933dd707976bf40f72aa12af4fa0 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Jaime=20Mart=C3=ADnez?= Date: Wed, 19 Jun 2024 14:34:45 +0200 Subject: [PATCH] Use int while converting Hsl to Rgb Gettings `Implicit conversion from float 192.54545454545453 to int loses precision` depprecated warnings on PHP 8.1. --- src/HSL.php | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/HSL.php b/src/HSL.php index 734f73d..b7b652e 100644 --- a/src/HSL.php +++ b/src/HSL.php @@ -154,7 +154,7 @@ public static function rgbToHSL(float $red, float $green, float $blue): array */ public static function hslToRgb(float $hue, float $saturation, float $lightness): array { - $h = ((360 + ($hue % 360)) % 360) / 360; + $h = ((360 + (intval($hue) % 360)) % 360) / 360; $s = $saturation / 100; $l = $lightness / 100;