From 6e005f2f326429c67bd61700b5e8f6c61c64c3a5 Mon Sep 17 00:00:00 2001 From: yuanjiajia <1139393632@qq.com> Date: Thu, 6 Jul 2023 15:59:05 +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 7613e66..19aaf09 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) ** (1/2.2); - $g = hexdec(substr($hexColor, 3, 2))/255 ** (1/2.2); - $b = hexdec(substr($hexColor, 5, 2))/255 ** (1/2.2); + $r = (hexdec(substr($hexColor, 1, 2))/256) ** 2.2; + $g = (hexdec(substr($hexColor, 3, 2))/256) ** 2.2; + $b = (hexdec(substr($hexColor, 5, 2))/256) ** 2.2; $floatColor = "$r $g $b"; return $floatColor; }