Browse Source

渲染测式 案例 开发

master
yuanjiajia 1 year ago
parent
commit
0c84442565
  1. 9
      src/utils/MatHelper.php

9
src/utils/MatHelper.php

@ -142,10 +142,11 @@ class MatHelper{
static function hex2floatColor($hexColor){ static function hex2floatColor($hexColor){
$floatColor = ''; $floatColor = '';
$hexColor = trim($hexColor); $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; return $floatColor;
} }
} }

Loading…
Cancel
Save