public static function hex2rgb($hex)
    {
        $hex = str_replace("#", "", $hex);
        $r = hexdec(substr($hex,0,2));
        $g = hexdec(substr($hex,2,2));
        $b = hexdec(substr($hex,4,2));
        return "$r,$g,$b";
    }
public static function hex2rgb($hex)
    {
        $hex = str_replace("#", "", $hex);
        $r = hexdec(substr($hex,0,2));
        $g = hexdec(substr($hex,2,2));
        $b = hexdec(substr($hex,4,2));
        return "$r,$g,$b";
    }
public static function hex2rgb ( $ hex ) { $ hex = str_replace ( "#" , "" , $ hex ) ; $ r = hexdec ( substr ( $ hex , 0 , 2 ) ) ; $ g = hexdec ( substr ( $ hex , 2 , 2 ) ) ; $ b = hexdec ( substr ( $ hex , 4 , 2 ) ) ; return "$r,$g,$b" ; }
Helper for converting a color to rbg
@param $hex
@return string
Helper for converting a color to rbg