getRed(_:green:blue:alpha:)
Returns the color object’s RGB component and opacity values in the respective arguments.
Declaration
func getRed(_ red: UnsafeMutablePointer<CGFloat>?, green: UnsafeMutablePointer<CGFloat>?, blue: UnsafeMutablePointer<CGFloat>?, alpha: UnsafeMutablePointer<CGFloat>?)Parameters
- red:
Upon return, contains the red component of the color object.
- green:
Upon return, contains the green component of the color object.
- blue:
Upon return, contains the blue component of the color object.
- alpha:
Upon return, contains the opacity value of the color object.
Discussion
If NULL is passed in as an argument, the method doesn’t set that value. This method works only with objects representing colors in the calibratedRGB or deviceRGB color space. Sending it to other objects raises an exception.