Contents

init(red:green:blue:colorSpace:)

Initialize a Core Image color object with the specified red, green, and blue component values as measured in the specified color space.

Declaration

convenience init?(red: CGFloat, green: CGFloat, blue: CGFloat, colorSpace: CGColorSpace)

Parameters

  • red:

    The color’s unpremultiplied red component value.

  • green:

    The color’s unpremultiplied green component value.

  • blue:

    The color’s unpremultiplied blue component value.

  • colorSpace:

    The color’s CGColorSpace which must have kCGColorSpaceModelRGB.

Return Value

An initialized CIColor instance.

Discussion

This will return null if the CGColorSpace is not kCGColorSpaceModelRGB. The RGB values can be outside the 0...1 range if the CGColorSpace is unclamped.

See Also

Initializing Color Objects