public function format($type)
    {
        switch (strtolower($type)) {

            case 'rgba':
                return $this->getRgba();

            case 'hex':
                return $this->getHex('#');

            case 'int':
            case 'integer':
                return $this->getInt();

            case 'array':
                return $this->getArray();

            case 'obj':
            case 'object':
                return $this;

            default:
                throw new \Intervention\Image\Exception\NotSupportedException(
                    "Color format ({$type}) is not supported."
                );
        }
    }
public function format($type)
    {
        switch (strtolower($type)) {

            case 'rgba':
                return $this->getRgba();

            case 'hex':
                return $this->getHex('#');

            case 'int':
            case 'integer':
                return $this->getInt();

            case 'array':
                return $this->getArray();

            case 'obj':
            case 'object':
                return $this;

            default:
                throw new \Intervention\Image\Exception\NotSupportedException(
                    "Color format ({$type}) is not supported."
                );
        }
    }
public function format ( $ type ) { switch ( strtolower ( $ type ) ) { case 'rgba' : return $ this -> getRgba ( ) ; case 'hex' : return $ this -> getHex ( '#' ) ; case 'int' : case 'integer' : return $ this -> getInt ( ) ; case 'array' : return $ this -> getArray ( ) ; case 'obj' : case 'object' : return $ this ; default : throw new \ Intervention \ Image \ Exception \ NotSupportedException ( "Color format ({$type}) is not supported." ) ; } }
Formats current color instance into given format

@param  string $type
@return mixed
Formats current color instance into given format