Lines Matching refs:hex
72 * Convert a hex color code to an rgb array
74 function hex2rgb($hex) {
76 $hex = str_replace('#', '', $hex);
79 if(strlen($hex) == 3){
80 $hex = substr($hex,0,1).
81 substr($hex,0,1).
82 substr($hex,1,1).
83 substr($hex,1,1).
84 substr($hex,2,1).
85 substr($hex,2,1);
90 'r' => hexdec(substr($hex, 0, 2)),
91 'g' => hexdec(substr($hex, 2, 2)),
92 'b' => hexdec(substr($hex, 4, 2))