<?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 QXonR; hgoKY: return $HWDST; goto mwu1q; w3nIO: $HWDST = self::$colors[$EqYVi++ % count(self::$colors)]; goto hgoKY; QXonR: static $EqYVi = 0; goto w3nIO; mwu1q: } public static function pick($LOtnq) { $EqYVi = abs(crc32($LOtnq)) % count(self::$colors); return self::$colors[$EqYVi]; } public static function adjust($Qxo6J, $sb32S) { goto khbau; M2qnT: $Y7i7h = hexdec($s83y_); goto zyG7d; i45RU: $QincN = substr($Qxo6J, 0, 2); goto FYUJh; khbau: $Qxo6J = strtoupper($Qxo6J); goto FcCtI; KUUQR: return '#' . strtoupper(join('', array(str_pad(dechex($d0vTi), 2, '0'), str_pad(dechex($Y9XFe), 2, '0'), str_pad(dechex($Y7i7h), 2, '0')))); goto NW9CH; FcCtI: if (!preg_match('/^#[A-F0-9]{6}$/', $Qxo6J)) { return $Qxo6J; } goto LMNa8; DYS5z: $d0vTi = hexdec($QincN); goto Y7bqg; D4JUO: $s83y_ = substr($Qxo6J, 4, 2); goto DYS5z; ESezU: $Y7i7h = max(0, min(255, $Y7i7h + $sb32S)); goto KUUQR; LMNa8: $Qxo6J = str_replace('#', '', $Qxo6J); goto i45RU; zyG7d: $d0vTi = max(0, min(255, $d0vTi + $sb32S)); goto oAcYP; Y7bqg: $Y9XFe = hexdec($MOSJU); goto M2qnT; oAcYP: $Y9XFe = max(0, min(255, $Y9XFe + $sb32S)); goto ESezU; FYUJh: $MOSJU = substr($Qxo6J, 2, 2); goto D4JUO; NW9CH: } }