<?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 SncQ5; OtZkU: return $hfJA2; goto F6hNs; SncQ5: static $R80S9 = 0; goto pnI4W; pnI4W: $hfJA2 = self::$colors[$R80S9++ % count(self::$colors)]; goto OtZkU; F6hNs: } public static function pick($c2v6v) { $R80S9 = abs(crc32($c2v6v)) % count(self::$colors); return self::$colors[$R80S9]; } public static function adjust($PkopF, $nzNjA) { goto nk8kG; mGMKt: $Wfxgj = max(0, min(255, $Wfxgj + $nzNjA)); goto MJ3V0; j0l2P: $UKTQf = substr($PkopF, 0, 2); goto LsmD2; sUG3X: $QFvMU = substr($PkopF, 4, 2); goto e5fXl; Zu1kc: return '#' . strtoupper(join('', array(str_pad(dechex($fGkn1), 2, '0'), str_pad(dechex($Wfxgj), 2, '0'), str_pad(dechex($v0l51), 2, '0')))); goto rtVKq; wbhK0: $fGkn1 = max(0, min(255, $fGkn1 + $nzNjA)); goto mGMKt; LsmD2: $V6D0d = substr($PkopF, 2, 2); goto sUG3X; e5fXl: $fGkn1 = hexdec($UKTQf); goto nlXVl; MJ3V0: $v0l51 = max(0, min(255, $v0l51 + $nzNjA)); goto Zu1kc; BrEVx: if (!preg_match('/^#[A-F0-9]{6}$/', $PkopF)) { return $PkopF; } goto lnIo3; nlXVl: $Wfxgj = hexdec($V6D0d); goto MmWiI; lnIo3: $PkopF = str_replace('#', '', $PkopF); goto j0l2P; nk8kG: $PkopF = strtoupper($PkopF); goto BrEVx; MmWiI: $v0l51 = hexdec($QFvMU); goto wbhK0; rtVKq: } }