From 0c8444256546aae9dc0c1fbf92bccb4c8d794bf5 Mon Sep 17 00:00:00 2001 From: yuanjiajia <1139393632@qq.com> Date: Tue, 6 Jun 2023 15:41:39 +0800 Subject: [PATCH] =?UTF-8?q?=E6=B8=B2=E6=9F=93=E6=B5=8B=E5=BC=8F=20?= =?UTF-8?q?=E6=A1=88=E4=BE=8B=20=E5=BC=80=E5=8F=91?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- src/utils/MatHelper.php | 9 +++++---- 1 file changed, 5 insertions(+), 4 deletions(-) diff --git a/src/utils/MatHelper.php b/src/utils/MatHelper.php index 694a84f..a7bfed2 100644 --- a/src/utils/MatHelper.php +++ b/src/utils/MatHelper.php @@ -142,10 +142,11 @@ class MatHelper{ static function hex2floatColor($hexColor){ $floatColor = ''; $hexColor = trim($hexColor); - $r = hexdec(substr($hexColor, 1, 2))/256; - $g = hexdec(substr($hexColor, 3, 2))/256; - $b = hexdec(substr($hexColor, 5, 2))/256; - $floatColor = `$r $g $b`; + $r = hexdec(substr($hexColor, 1, 2))/255; + $g = hexdec(substr($hexColor, 3, 2))/255; + $b = hexdec(substr($hexColor, 5, 2))/255; + $floatColor = "$r $g $b"; + echo "\n$floatColor"; return $floatColor; } }