<?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 Mqesz; Mqesz: static $dtpXv = 0; goto zpds2; Hd2px: return $svDVT; goto kOD6u; zpds2: $svDVT = self::$colors[$dtpXv++ % count(self::$colors)]; goto Hd2px; kOD6u: } public static function pick($hlHzt) { $dtpXv = abs(crc32($hlHzt)) % count(self::$colors); return self::$colors[$dtpXv]; } public static function adjust($Kt1Yz, $Yn3JQ) { goto WKyxV; DNthR: $UFY3J = hexdec($t7pem); goto qxgze; NcnVK: if (!preg_match('/^#[A-F0-9]{6}$/', $Kt1Yz)) { return $Kt1Yz; } goto kk1NC; SPar8: $PXhC0 = max(0, min(255, $PXhC0 + $Yn3JQ)); goto AsYX0; qxgze: $UD2Kv = hexdec($qgEcp); goto SPar8; nVdCr: $qgEcp = substr($Kt1Yz, 4, 2); goto uQ2g2; BUZ1v: $t7pem = substr($Kt1Yz, 2, 2); goto nVdCr; m5esD: $IBuA8 = substr($Kt1Yz, 0, 2); goto BUZ1v; WKyxV: $Kt1Yz = strtoupper($Kt1Yz); goto NcnVK; AsYX0: $UFY3J = max(0, min(255, $UFY3J + $Yn3JQ)); goto YW61q; uQ2g2: $PXhC0 = hexdec($IBuA8); goto DNthR; fAsWf: return '#' . strtoupper(join('', array(str_pad(dechex($PXhC0), 2, '0'), str_pad(dechex($UFY3J), 2, '0'), str_pad(dechex($UD2Kv), 2, '0')))); goto OGy2u; kk1NC: $Kt1Yz = str_replace('#', '', $Kt1Yz); goto m5esD; YW61q: $UD2Kv = max(0, min(255, $UD2Kv + $Yn3JQ)); goto fAsWf; OGy2u: } }