<?php
/**
 * ------------------------ 
 *  版权所有  www.tecmz.com
 *  商业版本请购买正版授权使用
 * ------------------------
*/ namespace ModStart\Core\Util; class ColorUtil { private static $colors = array('#FF7F50', '#DC143C', '#9932CC', '#B22222', '#DAA520', '#FF69B4', '#20B2AA', '#9370DB', '#3CB371', '#7B68EE', '#C71585', '#191970', '#FF8C00', '#DB7093', '#CD853F', '#BC8F8F', '#EE82EE', '#8B4513', '#FA8072', '#2E8B57', '#6B8E23', '#FF6347', '#ED3F14', '#4F7FF3', '#6A46BD', '#E9BD6C'); public static function randomColors() { return self::$colors; } public static function randomColor() { goto xAjrB; f3ggg: $wQkc8 = self::$colors[$ouMWs++ % count(self::$colors)]; goto uZJaY; uZJaY: return $wQkc8; goto vliLe; xAjrB: static $ouMWs = 0; goto f3ggg; vliLe: } public static function pick($ujvhK) { $ouMWs = abs(crc32($ujvhK)) % count(self::$colors); return self::$colors[$ouMWs]; } public static function adjust($XF5Yu, $sbbly) { goto BTZ7D; bYqtS: $cFF5G = substr($XF5Yu, 4, 2); goto pb2xw; UAaTp: $gNdbc = hexdec($cFF5G); goto GeUGs; A_RQu: if (!preg_match('/^#[A-F0-9]{6}$/', $XF5Yu)) { return $XF5Yu; } goto HjKef; zOgdH: return '#' . strtoupper(join('', array(str_pad(dechex($m86pK), 2, '0'), str_pad(dechex($zI7YS), 2, '0'), str_pad(dechex($gNdbc), 2, '0')))); goto J_2Xe; qOrLn: $Nt0OA = substr($XF5Yu, 0, 2); goto Eab3E; Eab3E: $fH6Xc = substr($XF5Yu, 2, 2); goto bYqtS; pb2xw: $m86pK = hexdec($Nt0OA); goto iYnud; HjKef: $XF5Yu = str_replace('#', '', $XF5Yu); goto qOrLn; JVpoW: $gNdbc = max(0, min(255, $gNdbc + $sbbly)); goto zOgdH; iYnud: $zI7YS = hexdec($fH6Xc); goto UAaTp; GeUGs: $m86pK = max(0, min(255, $m86pK + $sbbly)); goto ELDzZ; ELDzZ: $zI7YS = max(0, min(255, $zI7YS + $sbbly)); goto JVpoW; BTZ7D: $XF5Yu = strtoupper($XF5Yu); goto A_RQu; J_2Xe: } }