Creates a color object from a Quartz color.
SDKs
- iOS 5.0+
- macOS 10.4+
- Mac Catalyst 13.0+
- tvOS 9.0+
Framework
- Core Image
Declaration
+ (instancetype)colorWithCGColor:(CGColor Ref)c;
Parameters
c
A Quartz color (
CGColor
object) created using a Quartz color creation function such asRef CGColor
.Create
Return Value
A Core Image color object that represents a Quartz color.
Discussion
A CGColor
object is the fundamental opaque data type used internally by Quartz to represent colors. For more information on Quartz 2D color and color spaces, see Quartz 2D Programming Guide.
You can pass a CGColor
object that represents any color space, including CMYK. However, Core Image converts all color spaces to the Core Image working color space before it passes the color to the filter kernel. The Core Image working color space uses three color components plus alpha.