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
This commit is contained in:
Clemens Schwaighofer
2023-01-10 14:07:01 +09:00
parent eba1e2885f
commit 0328ccd2fe

View File

@@ -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;
}