Instance Method

getComponents(_:)

Returns the components of the receiver as an array.

Declaration

func getComponents(_ components: UnsafeMutablePointer<CGFloat>)

Parameters

components

An array containing the components of the color object as float values.

Discussion

You can invoke this method on NSColor objects created from custom color spaces to get the individual floating-point components, including alpha. Raises an exception if the receiver doesn’t have floating-point components. To find out how many components are in the components array, use the numberOfComponents property.