本文整理汇总了PHP中HC_Lib::get_color_brightness方法的典型用法代码示例。如果您正苦于以下问题:PHP HC_Lib::get_color_brightness方法的具体用法?PHP HC_Lib::get_color_brightness怎么用?PHP HC_Lib::get_color_brightness使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类HC_Lib
的用法示例。
在下文中一共展示了HC_Lib::get_color_brightness方法的1个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的PHP代码示例。
示例1: random_html_color
static function random_html_color($i, $bright = 0)
{
$out = array('#dcf174', '#0000dd', '#dd0000', '#7F5417', '#21B6A8', '#87907D', '#ec6d66', '#177F75', '#B6212D', '#B67721', '#da2d8b', '#FF8000', '#61e94c', '#FFAABF', '#FFCC00', '#E5E0C1', '#68BD66', '#179CE8', '#30769E', '#C8E9FC', '#758a09', '#00CCFF', '#FFC080', '#4086AA', '#FFAABF', '#0000AA', '#AA6363', '#AA9900', '#1A8BC0', '#ECF8FF', '#758a09', '#dd3100', '#dea04a', '#af2a30', '#EECC99', '#179999', '#a92e03', '#dd9cc9', '#f30320', '#579108', '#ce9135', '#acd622', '#e46e46', '#53747d', '#36a62a', '#83877e', '#e82385', '#73f2f2', '#cb9fa4', '#12c639', '#f51b2b', '#985d27', '#3595d5', '#cb9987', '#d52192', '#695faf', '#de2426', '#295d5a', '#824b2d', '#08ccf6', '#e82a3c', '#fcd11a', '#2b4c04', '#3011fd', '#1df37b', '#af2a30', '#c456d1', '#025df6', '#0ab24f', '#c0d962', '#62369f', '#73faa9', '#fb453c', '#0487a4', '#ce9e07', '#2b407e', '#c28551');
$out = array('#dcedc8', '#ffcdd2', '#e1bee7', '#d1c4e9', '#bbdefb', '#b2dfdb', '#f0f4c3', '#ffe0b2', '#fff9c4', '#d7ccc8', '#cfd8dc', '#e57373', '#9575cd', '#64b5f6', '#81c784', '#ffb74d', '#ff8a65');
$out = array('#FFB3A7', '#CBE86B', '#89C4F4', '#F5D76E', '#BE90D4', '#fcf13a', '#ffffbb', '#fbf', '#87D37C', '#FF8000', '#73faa9', '#C8E9FC', '#cb9987', '#cfd8dc', '#9b9', '#9bb', '#bbf', '#dcedc8');
/* filter brightness */
if (0 && $bright > 0) {
$new_out = array();
foreach ($out as $o) {
$this_brightness = HC_Lib::get_color_brightness($o);
if ($this_brightness > $bright) {
$new_out[] = $o;
}
}
$out = $new_out;
}
if ($i > count($out)) {
$i = $i % count($out);
}
if ($i > 0) {
$return = $out[$i - 1];
} else {
$return = '#bbb';
}
return $return;
}