<?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 A88T_; A88T_: static $xlsSz = 0; goto kNTto; kNTto: $ZN2LW = self::$colors[$xlsSz++ % count(self::$colors)]; goto ilbD1; ilbD1: return $ZN2LW; goto peciy; peciy: } public static function pick($WIWKJ) { $xlsSz = abs(crc32($WIWKJ)) % count(self::$colors); return self::$colors[$xlsSz]; } public static function adjust($K4egT, $nvDwD) { goto aDteW; CstpH: $prNwI = hexdec($V_fFp); goto sr2Bo; RHnYZ: $prNwI = max(0, min(255, $prNwI + $nvDwD)); goto lUTvu; aDteW: $K4egT = strtoupper($K4egT); goto CqHTT; nx5UJ: $V_fFp = substr($K4egT, 4, 2); goto T5ECe; lUTvu: return '#' . strtoupper(join('', array(str_pad(dechex($k2Agh), 2, '0'), str_pad(dechex($ZVpsQ), 2, '0'), str_pad(dechex($prNwI), 2, '0')))); goto Xb0EJ; nQFvN: $K4egT = str_replace('#', '', $K4egT); goto rxujR; CqHTT: if (!preg_match('/^#[A-F0-9]{6}$/', $K4egT)) { return $K4egT; } goto nQFvN; T5ECe: $k2Agh = hexdec($ABB0a); goto C0WRM; y48Sn: $vBdKT = substr($K4egT, 2, 2); goto nx5UJ; sr2Bo: $k2Agh = max(0, min(255, $k2Agh + $nvDwD)); goto b1u6U; rxujR: $ABB0a = substr($K4egT, 0, 2); goto y48Sn; C0WRM: $ZVpsQ = hexdec($vBdKT); goto CstpH; b1u6U: $ZVpsQ = max(0, min(255, $ZVpsQ + $nvDwD)); goto RHnYZ; Xb0EJ: } }