Instance Method

getHue:saturation:brightness:alpha:

Returns the components that make up the color in the HSB color space.

Declaration

- (BOOL)getHue:(CGFloat *)hue saturation:(CGFloat *)saturation brightness:(CGFloat *)brightness alpha:(CGFloat *)alpha;

Parameters

hue

On return, the hue component of the color object. On applications linked for iOS 10 or later, the hue component is specified in an extended range color space and can have any value. Values between 0.0 and 1.0 are inside the sRGB color gamut. On earlier versions of iOS, the specified value is always between 0.0 and 1.0.

saturation

On return, the saturation component of the color object. On applications linked for iOS 10 or later, the saturation component is specified in an extended range color space and can have any value. Values between 0.0 and 1.0 are inside the sRGB color gamut. On earlier versions of iOS, the specified value is always between 0.0 and 1.0.

brightness

On return, the brightness component of the color object. On applications linked for iOS 10 or later, the brightness component is specified in an extended range color space and can have any value. Values between 0.0 and 1.0 are inside the sRGB color gamut. On earlier versions of iOS, the specified value is always between 0.0 and 1.0.

alpha

On return, the opacity component of the color object, specified as a value between 0.0 and 1.0.

Return Value

YES if the color could be converted, NO otherwise.

Discussion

If the color is in a compatible color space, the color is converted into the HSB color space and its components are returned to your application. If the color is not in a compatible color space, the parameters are unchanged.

See Also

Getting the Color Information

CGColor

The Quartz color reference that corresponds to the receiver’s color.

- CGColor

The Quartz color reference that corresponds to the receiver’s color.

CIColor

The Core Image color associated with the receiver.

- getRed:green:blue:alpha:

Returns the components that make up the color in the RGB color space.

- getWhite:alpha:

Returns the grayscale components of the color.