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."
                );
        }
    }