public static function Color2Hex( $colorDefinition )
   {

      if ( \is_array( $colorDefinition ) )
      {
         if ( \count( $colorDefinition ) != 3 )
         {
            throw new ArgumentError(
               'colorDefinition',
               $colorDefinition,
               'Drawing',
               'A rgb array with 3 Elements is required!'
            );
         }
         return static::Rgb2Hex( $colorDefinition );
      }

      if ( static::IsHexFormat( $colorDefinition ) )
      {
         return $colorDefinition;
      }

      $uc = \strtolower( $colorDefinition );

      if ( isset( static::$ColornameHex[ $uc ] ) )
      {
         return \strtolower( static::$ColornameHex[ $uc ] );
      }

      if ( false !== ( $hex = static::Rgb2Hex( $colorDefinition ) ) )
      {
         return $hex;
      }

      return false;

   }
public static function Color2Hex( $colorDefinition )
   {

      if ( \is_array( $colorDefinition ) )
      {
         if ( \count( $colorDefinition ) != 3 )
         {
            throw new ArgumentError(
               'colorDefinition',
               $colorDefinition,
               'Drawing',
               'A rgb array with 3 Elements is required!'
            );
         }
         return static::Rgb2Hex( $colorDefinition );
      }

      if ( static::IsHexFormat( $colorDefinition ) )
      {
         return $colorDefinition;
      }

      $uc = \strtolower( $colorDefinition );

      if ( isset( static::$ColornameHex[ $uc ] ) )
      {
         return \strtolower( static::$ColornameHex[ $uc ] );
      }

      if ( false !== ( $hex = static::Rgb2Hex( $colorDefinition ) ) )
      {
         return $hex;
      }

      return false;

   }
public static function Color2Hex ( $ colorDefinition ) { if ( \ is_array ( $ colorDefinition ) ) { if ( \ count ( $ colorDefinition ) != 3 ) { throw new ArgumentError ( 'colorDefinition' , $ colorDefinition , 'Drawing' , 'A rgb array with 3 Elements is required!' ) ; } return static :: Rgb2Hex ( $ colorDefinition ) ; } if ( static :: IsHexFormat ( $ colorDefinition ) ) { return $ colorDefinition ; } $ uc = \ strtolower ( $ colorDefinition ) ; if ( isset ( static :: $ ColornameHex [ $ uc ] ) ) { return \ strtolower ( static :: $ ColornameHex [ $ uc ] ) ; } if ( false !== ( $ hex = static :: Rgb2Hex ( $ colorDefinition ) ) ) { return $ hex ; } return false ; }
Converts the defined Color definition into hexadecimal representation.

@param  string|array $colorDefinition Color name, RGB color array or Hex color definition
@return string|FALSE
@throws \Beluga\ArgumentError
Converts the defined Color definition into hexadecimal representation .