From 0328ccd2fe979ba97d6123854b8d8c200938b208 Mon Sep 17 00:00:00 2001 From: Clemens Schwaighofer Date: Tue, 10 Jan 2023 14:07:01 +0900 Subject: [PATCH] Convert\Colors fixes for from HSB/HSL Hue 360 If hue 360 is given, it is no longer an error but internally converted to 0 --- www/lib/CoreLibs/Convert/Colors.php | 6 ++++++ 1 file changed, 6 insertions(+) diff --git a/www/lib/CoreLibs/Convert/Colors.php b/www/lib/CoreLibs/Convert/Colors.php index feabf5be..7f3c9f62 100644 --- a/www/lib/CoreLibs/Convert/Colors.php +++ b/www/lib/CoreLibs/Convert/Colors.php @@ -150,6 +150,9 @@ class Colors { // check that H is 0 to 359, 360 = 0 // and S and V are 0 to 1 + if ($H == 360) { + $H = 0; + } if ($H < 0 || $H > 359) { return false; } @@ -287,6 +290,9 @@ class Colors if (!is_numeric($hue)) { return false; } + if ($hue == 360) { + $hue = 0; + } if ($hue < 0 || $hue > 359) { return false; }