From fcfae476574f1c2fa10979179d0444be5972d646 Mon Sep 17 00:00:00 2001 From: yuanjiajia <1139393632@qq.com> Date: Thu, 6 Jul 2023 15:29:36 +0800 Subject: [PATCH] =?UTF-8?q?=E6=B8=B2=E6=9F=93=E6=B5=8B=E5=BC=8F=20?= =?UTF-8?q?=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 | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/src/utils/MatHelper.php b/src/utils/MatHelper.php index b33946b..7613e66 100644 --- a/src/utils/MatHelper.php +++ b/src/utils/MatHelper.php @@ -230,9 +230,9 @@ class MatHelper{ static function hex2floatColor($hexColor){ $floatColor = ''; $hexColor = trim($hexColor); - $r = hexdec(substr($hexColor, 1, 2))/255; - $g = hexdec(substr($hexColor, 3, 2))/255; - $b = hexdec(substr($hexColor, 5, 2))/255; + $r = (hexdec(substr($hexColor, 1, 2))/255) ** (1/2.2); + $g = hexdec(substr($hexColor, 3, 2))/255 ** (1/2.2); + $b = hexdec(substr($hexColor, 5, 2))/255 ** (1/2.2); $floatColor = "$r $g $b"; return $floatColor; }