Contents

init(string:)

Create a Core Image color object in the sRGB color space using a string containing the RGBA color component values.

Declaration

convenience init(string representation: String)

Parameters

  • representation:

    A string that contains color and alpha float values. For example, the string: "0.5 0.7 0.3 1.0" indicates an RGB color whose components are 50% red, 70% green, 30% blue, and 100% opaque. If the string contains only 3 float values, the alpha component will be 1.0 If the string contains no float values, then /CIColor/clearColor will be returned.

Return Value

An autoreleased CIColor instance.

Discussion

On macOS before 10.10, the CIColor’s color space will be Generic RGB.

See Also

Creating Color Objects