Type Method

colorWithString:

Creates a color object using the RGBA color component values specified by a string.

Declaration

+ (instancetype)colorWithString:(NSString *)representation;

Parameters

representation

A string that is in one of the formats returned by the stringRepresentation method. 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 (alpha value of 1.0). The string representation always has four components—red, green, blue, and alpha. The default value for the alpha component is 1.0.

Return Value

A Core Image color object that represents an RGB color in the color space specified by the Quartz 2D constant kCGColorSpaceGenericRGB.

See Also

Creating Color Objects

+ colorWithCGColor:

Creates a color object from a Quartz color.

+ colorWithRed:green:blue:

Creates a color object using the specified RGB color component values

+ colorWithRed:green:blue:alpha:

Creates a color object using the specified RGBA color component values.

+ colorWithRed:green:blue:colorSpace:

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

+ colorWithRed:green:blue:alpha:colorSpace:

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

Beta Software

This documentation contains preliminary information about an API or technology in development. This information is subject to change, and software implemented according to this documentation should be tested with final operating system software.

Learn more about using Apple's beta software