public static function Hex2Rgb( string $color )
   {

      if ( $color[ 0 ] == '#' )
      {
         $color = \substr( $color, 1 );
      }

      if ( \strlen( $color ) == 8 )
      {
         $color = \substr( $color, 2 );
      }

      if ( \strlen( $color ) == 6 )
      {
         $r = $color[ 0 ] . $color[ 1 ];
         $g = $color[ 2 ] . $color[ 3 ];
         $b = $color[ 4 ] . $color[ 5 ];
      }
      else if ( \strlen( $color ) == 3 )
      {
         $r = $color[ 0 ] . $color[ 0 ];
         $g = $color[ 1 ] . $color[ 1 ];
         $b = $color[ 2 ] . $color[ 2 ];
      }
      else if ( \strlen( $color ) == 2 )
      {
         $r = $color;
         $g = $color;
         $b = $color;
      }
      else
      {
         return false;
      }

      return [ \hexdec( $r ), \hexdec( $g ), \hexdec( $b ) ];

   }
public static function Hex2Rgb( string $color )
   {

      if ( $color[ 0 ] == '#' )
      {
         $color = \substr( $color, 1 );
      }

      if ( \strlen( $color ) == 8 )
      {
         $color = \substr( $color, 2 );
      }

      if ( \strlen( $color ) == 6 )
      {
         $r = $color[ 0 ] . $color[ 1 ];
         $g = $color[ 2 ] . $color[ 3 ];
         $b = $color[ 4 ] . $color[ 5 ];
      }
      else if ( \strlen( $color ) == 3 )
      {
         $r = $color[ 0 ] . $color[ 0 ];
         $g = $color[ 1 ] . $color[ 1 ];
         $b = $color[ 2 ] . $color[ 2 ];
      }
      else if ( \strlen( $color ) == 2 )
      {
         $r = $color;
         $g = $color;
         $b = $color;
      }
      else
      {
         return false;
      }

      return [ \hexdec( $r ), \hexdec( $g ), \hexdec( $b ) ];

   }
public static function Hex2Rgb ( string $ color ) { if ( $ color [ 0 ] == '#' ) { $ color = \ substr ( $ color , 1 ) ; } if ( \ strlen ( $ color ) == 8 ) { $ color = \ substr ( $ color , 2 ) ; } if ( \ strlen ( $ color ) == 6 ) { $ r = $ color [ 0 ] . $ color [ 1 ] ; $ g = $ color [ 2 ] . $ color [ 3 ] ; $ b = $ color [ 4 ] . $ color [ 5 ] ; } else if ( \ strlen ( $ color ) == 3 ) { $ r = $ color [ 0 ] . $ color [ 0 ] ; $ g = $ color [ 1 ] . $ color [ 1 ] ; $ b = $ color [ 2 ] . $ color [ 2 ] ; } else if ( \ strlen ( $ color ) == 2 ) { $ r = $ color ; $ g = $ color ; $ b = $ color ; } else { return false ; } return [ \ hexdec ( $ r ) , \ hexdec ( $ g ) , \ hexdec ( $ b ) ] ; }
Convert a color from hexadecimal notation to RGB array.

@param  string $color
@return array|bool
Convert a color from hexadecimal notation to RGB array .