public static function fromHexString($color)
    {
        $color = rtrim($color, '#');
        preg_match_all('([0-9a-f][0-9a-f])', $color, $rgb);

        $c = new self();
        list($c->r, $c->g, $c->b) = array_map('hexdec', $rgb[0]);

        return $c;
    }
public static function fromHexString($color)
    {
        $color = rtrim($color, '#');
        preg_match_all('([0-9a-f][0-9a-f])', $color, $rgb);

        $c = new self();
        list($c->r, $c->g, $c->b) = array_map('hexdec', $rgb[0]);

        return $c;
    }
public static function fromHexString ( $ color ) { $ color = rtrim ( $ color , '#' ) ; preg_match_all ( '([0-9a-f][0-9a-f])' , $ color , $ rgb ) ; $ c = new self ( ) ; list ( $ c -> r , $ c -> g , $ c -> b ) = array_map ( 'hexdec' , $ rgb [ 0 ] ) ; return $ c ; }
Construct a Color from hex string

@param string $color The hex string
@returns Color the color object
Construct a Color from hex string