iOS Developer Library

Developer

Core Text Reference Collection CGColorSpace Reference

Options
Deployment Target:

On This Page
Language:

CGColorSpace Reference

The CGColorSpaceRef opaque type encapsulates color space information that is used to specify how Quartz interprets color information. A color space specifies how color values are interpreted. A color space is multi-dimensional, and each dimension represents a specific color component. For example, the colors in an RGB color space have three dimensions or components—red, green, and blue. The intensity of each component is represented by floating point values—their range and meaning depends on the color space in question.

Different types of devices (scanners, monitors, printers) operate within different color spaces (RGB, CMYK, grayscale). Additionally, two devices of the same type (for example, color displays from different manufacturers) may operate within the same kind of color space, yet still produce a different range of colors, or gamut. Color spaces that are correctly specified ensure that an image has a consistent appearance regardless of the output device.

Quartz supports several kinds of color spaces:

  • Calibrated color spaces ensure that colors appear the same when displayed on different devices. The visual appearance of the color is preserved, as far as the capabilities of the device allow.

  • Device-dependent color spaces are tied to the system of color representation of a particular device. Device color spaces are not recommended when high-fidelity color preservation is important.

  • Special color spaces—indexed and pattern. An indexed color space contains a color table with up to 256 entries and a base color space to which the color table entries are mapped. Each entry in the color table specifies one color in the base color space. A pattern color space is used when stroking or filling with a pattern. Pattern color spaces are supported in OS X version 10.1 and later.

Functions

  • Creates a calibrated grayscale color space.

    Declaration

    Swift

    func CGColorSpaceCreateCalibratedGray(_ whitePoint: UnsafePointer<CGFloat>, _ blackPoint: UnsafePointer<CGFloat>, _ gamma: CGFloat) -> CGColorSpace?

    Objective-C

    CGColorSpaceRef CGColorSpaceCreateCalibratedGray ( const CGFloat whitePoint[3], const CGFloat blackPoint[3], CGFloat gamma );

    Parameters

    whitePoint

    An array of 3 numbers specifying the tristimulus value, in the CIE 1931 XYZ-space, of the diffuse white point.

    blackPoint

    An array of 3 numbers specifying the tristimulus value, in CIE 1931 XYZ-space, of the diffuse black point.

    gamma

    The gamma value appropriate for the imaging device.

    Return Value

    A new calibrated gray color space. You are responsible for releasing this object by calling CGColorSpaceRelease. If unsuccessful, returns NULL.

    Discussion

    Creates a device-independent grayscale color space that represents colors relative to a reference white point. This white point is based on the whitest light that can be generated by the output device. Colors in a device-independent color space should appear the same when displayed on different devices, to the extent that the capabilities of the device allow.

    Availability

    Available in iOS 2.0 and later.

  • Creates a calibrated RGB color space.

    Declaration

    Swift

    func CGColorSpaceCreateCalibratedRGB(_ whitePoint: UnsafePointer<CGFloat>, _ blackPoint: UnsafePointer<CGFloat>, _ gamma: UnsafePointer<CGFloat>, _ matrix: UnsafePointer<CGFloat>) -> CGColorSpace?

    Objective-C

    CGColorSpaceRef CGColorSpaceCreateCalibratedRGB ( const CGFloat whitePoint[3], const CGFloat blackPoint[3], const CGFloat gamma[3], const CGFloat matrix[9] );

    Parameters

    whitePoint

    An array of 3 numbers specifying the tristimulus value, in the CIE 1931 XYZ-space, of the diffuse white point.

    blackPoint

    An array of 3 numbers specifying the tristimulus value, in CIE 1931 XYZ-space, of the diffuse black point.

    gamma

    An array of 3 numbers specifying the gamma for the red, green, and blue components of the color space.

    matrix

    An array of 9 numbers specifying the linear interpretation of the gamma-modified RGB values of the color space with respect to the final XYZ representation.

    Return Value

    A new calibrated RGB color space. You are responsible for releasing this object by calling CGColorSpaceRelease. If unsuccessful, returns NULL.

    Discussion

    Creates a device-independent RGB color space that represents colors relative to a reference white point. This white point is based on the whitest light that can be generated by the output device. Colors in a device-independent color space should appear the same when displayed on different devices, to the extent that the capabilities of the device allow.

    For color spaces that require a detailed gamma, such as the piecewise transfer function used in sRGB or ITU-R BT.709, you may want to use the function CGColorSpaceCreateICCBased instead, because it can accurately represent these gamma curves.

    Availability

    Available in iOS 2.0 and later.

  • Creates a device-independent color space that is defined according to the ICC color profile specification.

    Declaration

    Swift

    func CGColorSpaceCreateICCBased(_ nComponents: Int, _ range: UnsafePointer<CGFloat>, _ profile: CGDataProvider?, _ alternate: CGColorSpace?) -> CGColorSpace?

    Objective-C

    CGColorSpaceRef CGColorSpaceCreateICCBased ( size_t nComponents, const CGFloat *range, CGDataProviderRef profile, CGColorSpaceRef alternate );

    Parameters

    nComponents

    The number of color components in the color space defined by the ICC profile data. This must match the number of components actually in the ICC profile and must equal 1, 3, or 4.

    range

    An array of numbers that specify the minimum and maximum valid values of the corresponding color components. The size of the array is two times the number of components. If c[k] is the kthe color component, the valid range is range[2*k] range[2*k+1].

    profile

    A data provider that supplies the ICC profile.

    alternateSpace

    An alternate color space to use in case the ICC profile is not supported. The alternate color space must have nComponents color components. You must supply an alternate color space. If this parameter is NULL, then the function returns NULL.

    Return Value

    A new ICC-based color space object. You are responsible for releasing this object by calling CGColorSpaceRelease. If unsuccessful, returns NULL.

    Discussion

    This function creates an ICC-based color space from an ICC color profile, as defined by the International Color Consortium. ICC profiles define the reproducible color gamut (the range of colors supported by a device) and other characteristics of a particular output device, providing a way to accurately transform the color space of one device to the color space of another. The ICC profile is usually provided by the manufacturer of the device. Additionally, some color monitors and printers contain electronically embedded ICC profile information, as do some bitmap formats such as TIFF. Colors in a device-independent color space should appear the same when displayed on different devices, to the extent that the capabilities of the device allow.

    You may want to use this function for a color space that requires a detailed gamma, such as the piecewise transfer function used in sRGB or ITU-R BT.709, because this function can accurately represent these gamma curves.

    Availability

    Available in iOS 2.0 and later.

  • Creates an ICC-based color space using the ICC profile contained in the specified data.

    Declaration

    Swift

    func CGColorSpaceCreateWithICCProfile(_ data: CFData?) -> CGColorSpace?

    Objective-C

    CGColorSpaceRef CGColorSpaceCreateWithICCProfile ( CFDataRef data );

    Parameters

    data

    The data containing the ICC profile to set for the new color space.

    Return Value

    A new color space based on the specified profile.

    Availability

    Available in iOS 2.0 and later.

  • Creates a device-independent color space that is relative to human color perception, according to the CIE L*a*b* standard.

    Declaration

    Swift

    func CGColorSpaceCreateLab(_ whitePoint: UnsafePointer<CGFloat>, _ blackPoint: UnsafePointer<CGFloat>, _ range: UnsafePointer<CGFloat>) -> CGColorSpace?

    Objective-C

    CGColorSpaceRef CGColorSpaceCreateLab ( const CGFloat whitePoint[3], const CGFloat blackPoint[3], const CGFloat range[4] );

    Parameters

    whitePoint

    An array of 3 numbers that specify the tristimulus value, in the CIE 1931 XYZ-space, of the diffuse white point.

    blackPoint

    An array of 3 numbers that specify the tristimulus value, in CIE 1931 XYZ-space, of the diffuse black point.

    range

    An array of 4 numbers that specify the range of valid values for the a* and b* components of the color space. The a* component represents values running from green to red, and the b* component represents values running from blue to yellow.

    Return Value

    A new L*a*b* color space. You are responsible for releasing this object by calling CGColorSpaceRelease. If unsuccessful, returns NULL.

    Discussion

    The CIE L*a*b* space is a nonlinear transformation of the Munsell color notation system (a system which specifies colors by hue, value, and saturation—or “chroma”—values), designed to match perceived color difference with quantitative distance in color space. The L* component represents the lightness value, the a* component represents values running from green to red, and the b* component represents values running from blue to yellow. This roughly corresponds to the way the human brain is thought to decode colors. Colors in a device-independent color space should appear the same when displayed on different devices, to the extent that the capabilities of the device allow.

    Availability

    Available in iOS 2.0 and later.

  • Creates a device-dependent CMYK color space.

    Declaration

    Swift

    func CGColorSpaceCreateDeviceCMYK() -> CGColorSpace?

    Objective-C

    CGColorSpaceRef CGColorSpaceCreateDeviceCMYK ( void );

    Return Value

    A device-dependent CMYK color space. You are responsible for releasing this object by calling CGColorSpaceRelease. If unsuccessful, returns NULL.

    Discussion

    Colors in a device-dependent color space are not transformed or otherwise modified when displayed on an output device—that is, there is no attempt to maintain the visual appearance of a color. As a consequence, colors in a device color space often appear different when displayed on different output devices. For this reason, device color spaces are not recommended when color preservation is important.

    Availability

    Available in iOS 2.0 and later.

  • Creates a device-dependent grayscale color space.

    Declaration

    Swift

    func CGColorSpaceCreateDeviceGray() -> CGColorSpace?

    Objective-C

    CGColorSpaceRef CGColorSpaceCreateDeviceGray ( void );

    Return Value

    A device-dependent gray color space. You are responsible for releasing this object by calling CGColorSpaceRelease. If unsuccessful, returns NULL.

    Discussion

    Colors in a device-dependent color space are not transformed or otherwise modified when displayed on an output device—that is, there is no attempt to maintain the visual appearance of a color. As a consequence, colors in a device color space often appear different when displayed on different output devices. For this reason, device color spaces are not recommended when color preservation is important.

    Availability

    Available in iOS 2.0 and later.

  • Creates a device-dependent RGB color space.

    Declaration

    Swift

    func CGColorSpaceCreateDeviceRGB() -> CGColorSpace?

    Objective-C

    CGColorSpaceRef CGColorSpaceCreateDeviceRGB ( void );

    Return Value

    A device-dependent RGB color space. You are responsible for releasing this object by calling CGColorSpaceRelease. If unsuccessful, returns NULL.

    Discussion

    Colors in a device-dependent color space are not transformed or otherwise modified when displayed on an output device—that is, there is no attempt to maintain the visual appearance of a color. As a consequence, colors in a device color space often appear different when displayed on different output devices. For this reason, device color spaces are not recommended when color preservation is important.

    Availability

    Available in iOS 2.0 and later.

  • Creates a platform-specific color space.

    Declaration

    Swift

    func CGColorSpaceCreateWithPlatformColorSpace(_ ref: UnsafePointer<Void>) -> CGColorSpace?

    Objective-C

    CGColorSpaceRef CGColorSpaceCreateWithPlatformColorSpace ( const void *ref );

    Parameters

    platformColorSpace

    A generic pointer to a platform-specific color space. In OS X, pass a CMProfileRef—a ColorSync profile. Quartz uses this pointer (and the underlying information) only during the function call.

    Return Value

    A new color space. You are responsible for releasing this object by calling CGColorSpaceRelease. If unsuccessful, returns NULL.

    Discussion

    Colors in a device-dependent color space are not transformed or otherwise modified when displayed on an output device—that is, there is no attempt to maintain the visual appearance of a color. As a consequence, colors in a device color space often appear different when displayed on different output devices. For this reason, device color spaces are not recommended when color preservation is important.

    Availability

    Available in iOS 9.0 and later.

  • Creates an indexed color space, consisting of colors specified by a color lookup table.

    Declaration

    Swift

    func CGColorSpaceCreateIndexed(_ baseSpace: CGColorSpace?, _ lastIndex: Int, _ colorTable: UnsafePointer<UInt8>) -> CGColorSpace?

    Objective-C

    CGColorSpaceRef CGColorSpaceCreateIndexed ( CGColorSpaceRef baseSpace, size_t lastIndex, const unsigned char *colorTable );

    Parameters

    baseSpace

    The color space on which the color table is based.

    lastIndex

    The maximum valid index value for the color table. The value must be less than or equal to 255.

    colorTable

    An array of m*(lastIndex+1) bytes, where m is the number of color components in the base color space. Each byte is an unsigned integer in the range 0 to 255 that is scaled to the range of the corresponding color component in the base color space.

    Return Value

    A new indexed color space object. You are responsible for releasing this object by calling CGColorSpaceRelease. If unsuccessful, returns NULL.

    Discussion

    An indexed color space contains a color table with up to 255 entries, and a base color space to which the color table entries are mapped. Each entry in the color table specifies one color in the base color space. A value in an indexed color space is treated as an index into the color table of the color space. The data in the table is in meshed format. (For example, for an RGB color space the values are R, G, B, R, G, B, and so on.)

    Availability

    Available in iOS 2.0 and later.

  • Creates a pattern color space.

    Declaration

    Swift

    func CGColorSpaceCreatePattern(_ baseSpace: CGColorSpace?) -> CGColorSpace?

    Objective-C

    CGColorSpaceRef CGColorSpaceCreatePattern ( CGColorSpaceRef baseSpace );

    Parameters

    baseSpace

    For masking patterns, the underlying color space that specifies the colors to be painted through the mask. For colored patterns, you should pass NULL.

    Return Value

    A new pattern color space. You are responsible for releasing this object by calling CGColorSpaceRelease. If unsuccessful, returns NULL.

    Discussion

    For information on creating and using patterns, see Quartz 2D Programming Guide and CGPattern Reference. Quartz retains the color space you pass in. Upon return, you may safely release it by calling CGColorSpaceRelease.

    Availability

    Available in iOS 2.0 and later.

  • Creates a specified type of Quartz color space.

    Declaration

    Swift

    func CGColorSpaceCreateWithName(_ name: CFString?) -> CGColorSpace?

    Objective-C

    CGColorSpaceRef CGColorSpaceCreateWithName ( CFStringRef name );

    Parameters

    name

    A color space name. See “Color Space Names” for a list of the valid Quartz-defined names.

    Return Value

    A new generic color space. You are responsible for releasing this object by calling CGColorSpaceRelease. If unsuccessful, returns NULL.

    Discussion

    You can use this function to create a generic color space. For more information, see “Color Space Names”.

    Availability

    Available in iOS 2.0 and later.

  • Decrements the retain count of a color space.

    Declaration

    Objective-C

    void CGColorSpaceRelease ( CGColorSpaceRef space );

    Parameters

    cs

    The Quartz color space to release.

    Discussion

    This function is equivalent to CFRelease, except that it does not cause an error if the cs parameter is NULL.

    Availability

    Available in iOS 2.0 and later.

  • Increments the retain count of a color space.

    Declaration

    Objective-C

    CGColorSpaceRef CGColorSpaceRetain ( CGColorSpaceRef space );

    Parameters

    cs

    The Quartz color space to retain.

    Return Value

    The same color space you passed in as the cs parameter.

    Discussion

    This function is equivalent to CFRetain, except that it does not cause an error if the cs parameter is NULL.

    Availability

    Available in iOS 2.0 and later.

Data Types

  • An opaque type that encapsulates color space information.

    Declaration

    Swift

    class CGColorSpace { }

    Objective-C

    typedef struct CGColorSpace *CGColorSpaceRef;

    Import Statement

    Objective-C

    @import CoreGraphics;

    Swift

    import CoreGraphics

    Availability

    Available in iOS 2.0 and later.

Constants

  • Convenience constants for commonly used color spaces.

    Declaration

    Swift

    let kCGColorSpaceGenericGray: CFString let kCGColorSpaceGenericRGB: CFString let kCGColorSpaceGenericCMYK: CFString let kCGColorSpaceGenericRGBLinear: CFString let kCGColorSpaceAdobeRGB1998: CFString let kCGColorSpaceSRGB: CFString let kCGColorSpaceGenericGrayGamma2_2: CFString let kCGColorSpaceGenericXYZ: CFString let kCGColorSpaceACESCGLinear: CFString let kCGColorSpaceITUR_709: CFString let kCGColorSpaceITUR_2020: CFString let kCGColorSpaceROMMRGB: CFString let kCGColorSpaceDCIP3: CFString let kCGColorSpaceDisplayP3: CFString

    Objective-C

    CFStringRef kCGColorSpaceGenericGray CFStringRef kCGColorSpaceGenericRGB CFStringRef kCGColorSpaceGenericCMYK CFStringRef kCGColorSpaceGenericRGBLinear CFStringRef kCGColorSpaceAdobeRGB1998 CFStringRef kCGColorSpaceSRGB CFStringRef kCGColorSpaceGenericGrayGamma2_2 CFStringRef kCGColorSpaceGenericXYZ CFStringRef kCGColorSpaceACESCGLinear CFStringRef kCGColorSpaceITUR_709 CFStringRef kCGColorSpaceITUR_2020 CFStringRef kCGColorSpaceROMMRGB CFStringRef kCGColorSpaceDCIP3 CFStringRef kCGColorSpaceDisplayP3

    Constants

    • kCGColorSpaceGenericGray

      kCGColorSpaceGenericGray

      The name of the generic gray color space.

      Available in iOS 9.0 and later.

    • kCGColorSpaceGenericRGB

      kCGColorSpaceGenericRGB

      The name of the generic RGB color space.

      Available in iOS 9.0 and later.

    • kCGColorSpaceGenericCMYK

      kCGColorSpaceGenericCMYK

      The name of the generic CMYK color space.

      Available in iOS 9.0 and later.

    • kCGColorSpaceGenericRGBLinear

      kCGColorSpaceGenericRGBLinear

      The name of the generic linear RGB color space. This is the same as kCGColorSpaceGenericRGB, but with a gamma equal to 1.0.

      Available in iOS 9.0 and later.

    • kCGColorSpaceAdobeRGB1998

      kCGColorSpaceAdobeRGB1998

      The name of the Adobe RGB (1998) color space. For more information, see "Adobe RGB (1998) Color Image Encoding", Version 2005-05, Adobe Systems Inc. (http://www.adobe.com).

      Available in iOS 9.0 and later.

    • kCGColorSpaceSRGB

      kCGColorSpaceSRGB

      The name of the SRGB color space.

      Available in iOS 9.0 and later.

    • kCGColorSpaceGenericGrayGamma2_2

      kCGColorSpaceGenericGrayGamma2_2

      The name of the generic gray color space with a gamma value of 2.2.

      Available in iOS 9.0 and later.

    • kCGColorSpaceGenericXYZ

      kCGColorSpaceGenericXYZ

      The name of the generic XYZ color space.

      Available in iOS 9.0 and later.

    • kCGColorSpaceACESCGLinear

      kCGColorSpaceACESCGLinear

      The name of the ACEScg color space. For more information, see “ACEScg — A Working Space for CGI Render and Compositing”, Version 1.0.1, Academy of Motion Picture Arts and Sciences (http://www.oscars.org/science-technology/sci-tech-projects/aces).

      Available in iOS 9.0 and later.

    • kCGColorSpaceITUR_709

      kCGColorSpaceITUR_709

      The name of the ITU-R Recommendation BT.709 color space. For more information, see “BT.709 : Parameter values for the HDTV standards for production and international programme exchange”, Version 2015-06, International Telecommunication Union (https://www.itu.int/rec/R-REC-BT.709).

      Available in iOS 9.0 and later.

    • kCGColorSpaceITUR_2020

      kCGColorSpaceITUR_2020

      The name of the ITU-R Recommendation BT.2020 color space. For more information, see “BT.2020 : Parameter values for ultra-high definition television systems for production and international programme exchange”, Version 2014-06, International Telecommunication Union (https://www.itu.int/rec/R-REC-BT.2020).

      Available in iOS 9.0 and later.

    • kCGColorSpaceROMMRGB

      kCGColorSpaceROMMRGB

      The name of the ROMM RGB color space. For more information, see “Reference Output Medium Metric RGB Color Space (ROMM RGB) White Paper”, Version 2.1, Eastman Kodak Company (http://www.kodak.com/global/plugins/acrobat/en/professional/products/software/colorFlow/romm_rgb.pdf).

      Available in iOS 9.0 and later.

    • kCGColorSpaceDCIP3

      kCGColorSpaceDCIP3

      The name of the DCI P3 color space, created by Digital Cinema Initiatives, LLC. This color space is the digital cinema standard.

      Available in iOS 9.0 and later.

    • kCGColorSpaceDisplayP3

      kCGColorSpaceDisplayP3

      The name of the Display P3 color space, created by Apple Inc. This color space uses the DCI P3 primaries, a D65 white point, and the same gamma curve as the sRGB color space.

      Available in iOS 9.0 and later.

    Discussion

    A color space name constant can be passed as a parameter to the function CGColorSpaceCreateWithName.

  • Models for color spaces.

    Declaration

    Swift

    enum CGColorSpaceModel : Int32 { case Unknown case Monochrome case RGB case CMYK case Lab case DeviceN case Indexed case Pattern }

    Objective-C

    enum CGColorSpaceModel { kCGColorSpaceModelUnknown = -1, kCGColorSpaceModelMonochrome, kCGColorSpaceModelRGB, kCGColorSpaceModelCMYK, kCGColorSpaceModelLab, kCGColorSpaceModelDeviceN, kCGColorSpaceModelIndexed, kCGColorSpaceModelPattern }; typedef int32_t CGColorSpaceModel;

    Constants

    • Unknown

      kCGColorSpaceModelUnknown

      An unknown color space model.

      Available in iOS 2.0 and later.

    • Monochrome

      kCGColorSpaceModelMonochrome

      A monochrome color space model.

      Available in iOS 2.0 and later.

    • RGB

      kCGColorSpaceModelRGB

      An RGB color space model.

      Available in iOS 2.0 and later.

    • CMYK

      kCGColorSpaceModelCMYK

      A CMYK color space model.

      Available in iOS 2.0 and later.

    • Lab

      kCGColorSpaceModelLab

      A Lab color space model.

      Available in iOS 2.0 and later.

    • DeviceN

      kCGColorSpaceModelDeviceN

      A DeviceN color space model.

      Available in iOS 2.0 and later.

    • Indexed

      kCGColorSpaceModelIndexed

      An indexed color space model.

      Available in iOS 2.0 and later.

    • Pattern

      kCGColorSpaceModelPattern

      A pattern color space model.

      Available in iOS 2.0 and later.

    Import Statement

    Objective-C

    @import CoreGraphics;

    Swift

    import CoreGraphics

    Availability

    Available in iOS 2.0 and later.

  • Handling options for colors that are not located within the destination color space of a graphics context.

    Declaration

    Swift

    enum CGColorRenderingIntent : Int32 { case RenderingIntentDefault case RenderingIntentAbsoluteColorimetric case RenderingIntentRelativeColorimetric case RenderingIntentPerceptual case RenderingIntentSaturation }

    Objective-C

    enum CGColorRenderingIntent { kCGRenderingIntentDefault, kCGRenderingIntentAbsoluteColorimetric, kCGRenderingIntentRelativeColorimetric, kCGRenderingIntentPerceptual, kCGRenderingIntentSaturation }; typedef enum CGColorRenderingIntent CGColorRenderingIntent;

    Constants

    • RenderingIntentDefault

      kCGRenderingIntentDefault

      The default rendering intent for the graphics context.

      Available in iOS 2.0 and later.

    • RenderingIntentAbsoluteColorimetric

      kCGRenderingIntentAbsoluteColorimetric

      Map colors outside of the gamut of the output device to the closest possible match inside the gamut of the output device. This can produce a clipping effect, where two different color values in the gamut of the graphics context are mapped to the same color value in the output device’s gamut. Unlike the relative colorimetric, absolute colorimetric does not modify colors inside the gamut of the output device.

      Available in iOS 2.0 and later.

    • RenderingIntentRelativeColorimetric

      kCGRenderingIntentRelativeColorimetric

      Map colors outside of the gamut of the output device to the closest possible match inside the gamut of the output device. This can produce a clipping effect, where two different color values in the gamut of the graphics context are mapped to the same color value in the output device’s gamut. The relative colorimetric shifts all colors (including those within the gamut) to account for the difference between the white point of the graphics context and the white point of the output device.

      Available in iOS 2.0 and later.

    • RenderingIntentPerceptual

      kCGRenderingIntentPerceptual

      Preserve the visual relationship between colors by compressing the gamut of the graphics context to fit inside the gamut of the output device. Perceptual intent is good for photographs and other complex, detailed images.

      Available in iOS 2.0 and later.

    • RenderingIntentSaturation

      kCGRenderingIntentSaturation

      Preserve the relative saturation value of the colors when converting into the gamut of the output device. The result is an image with bright, saturated colors. Saturation intent is good for reproducing images with low detail, such as presentation charts and graphs.

      Available in iOS 2.0 and later.

    Discussion

    The rendering intent specifies how Quartz should handle colors that are not located within the gamut of the destination color space of a graphics context. It determines the exact method used to map colors from one color space to another. If you do not explicitly set the rendering intent by calling the function CGContextSetRenderingIntent, the graphics context uses the relative colorimetric rendering intent, except when drawing sampled images.

    Import Statement

    Objective-C

    @import CoreGraphics;

    Swift

    import CoreGraphics

    Availability

    Available in iOS 2.0 and later.