<?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 uOu1j; ZjFeZ: $bsOGg = self::$colors[$aDVv6++ % count(self::$colors)]; goto k7pSv; uOu1j: static $aDVv6 = 0; goto ZjFeZ; k7pSv: return $bsOGg; goto UTflA; UTflA: } public static function pick($LjRQH) { $aDVv6 = abs(crc32($LjRQH)) % count(self::$colors); return self::$colors[$aDVv6]; } public static function adjust($Cgdob, $RVJ1M) { goto bUc9z; rajZS: $zdV1h = hexdec($IXk27); goto DlWz_; xylRx: $jIfBL = substr($Cgdob, 4, 2); goto rajZS; FEZ_M: $VD4s3 = substr($Cgdob, 2, 2); goto xylRx; o4QyF: $zdV1h = max(0, min(255, $zdV1h + $RVJ1M)); goto FkeHb; QfIDy: if (!preg_match('/^#[A-F0-9]{6}$/', $Cgdob)) { return $Cgdob; } goto UROZ0; P1vhA: $ae8Ll = max(0, min(255, $ae8Ll + $RVJ1M)); goto JU9NR; DlWz_: $X9Hxk = hexdec($VD4s3); goto jXzRI; j057i: $IXk27 = substr($Cgdob, 0, 2); goto FEZ_M; jXzRI: $ae8Ll = hexdec($jIfBL); goto o4QyF; FkeHb: $X9Hxk = max(0, min(255, $X9Hxk + $RVJ1M)); goto P1vhA; bUc9z: $Cgdob = strtoupper($Cgdob); goto QfIDy; JU9NR: return '#' . strtoupper(join('', array(str_pad(dechex($zdV1h), 2, '0'), str_pad(dechex($X9Hxk), 2, '0'), str_pad(dechex($ae8Ll), 2, '0')))); goto jG_50; UROZ0: $Cgdob = str_replace('#', '', $Cgdob); goto j057i; jG_50: } }