function ums_clr($r) { $ra = array('2387d5', '2387d5', '85b933', '85b933', '8a50c8', '8a50c8', 'f2c627', 'f2c627', 'e11419', 'e11419'); foreach ($r as $k => $v) { $clr = $ra[$k] ? $ra[$k] : dechex(round($v * 16000000)); //if($k/2==round($k/2))$clr=$clr; $ret[$k] = hexrgb_r($clr); } return $ret; }
function imgclr($im, $d, $a = '') { $r = hexrgb_r($d); if ($a) { return imagecolorallocatealpha($im, $r[0], $r[1], $r[2], $a); } else { return imagecolorallocate($im, $r[0], $r[1], $r[2]); } }
function hexrgb($d, $o = '') { $r = hexrgb_r($d); return 'rgba(' . $r[0] . ',' . $r[1] . ',' . $r[2] . ',' . $o . ')'; }