CGColorSpace
A profile that specifies how to interpret a color value for display.
Declaration
class CGColorSpaceOverview
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.
Core Graphics 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.
Topics
Creating Color Spaces
init(calibratedGrayWhitePoint:blackPoint:gamma:)init(calibratedRGBWhitePoint:blackPoint:gamma:matrix:)init(iccBasedNComponents:range:profile:alternate:)init(indexedBaseSpace:last:colorTable:)init(labWhitePoint:blackPoint:range:)init(patternBaseSpace:)init(name:)init(platformColorSpaceRef:)init(iccData:)init(propertyListPlist:)CGColorSpaceCreateDeviceRGB()CGColorSpaceCreateDeviceCMYK()CGColorSpaceCreateDeviceGray()init(iccProfileData:)
Examining a Color Space
baseColorSpacenumberOfComponentsmodelCGColorSpaceModelcolorTablecopyICCData()copyPropertyList()iccDatanamesupportsOutputisWideGamutRGB
Accessing System-Defined Color Spaces
displayP3displayP3_HLGdisplayP3_PQ_EOTFextendedLinearDisplayP3sRGBlinearSRGBextendedSRGBextendedLinearSRGBgenericGrayGamma2_2extendedGraylinearGrayextendedLinearGraygenericCMYKgenericRGBLineargenericXYZgenericLabacescgLinearadobeRGB1998dcip3itur_709rommrgbitur_2020itur_2020_HLGitur_2020_PQ_EOTFextendedLinearITUR_2020coreMedia709displayP3_PQextendedDisplayP3extendedITUR_2020itur_2020_PQitur_2020_sRGBGammaitur_2100_HLGitur_2100_PQitur_709_HLGitur_709_PQlinearDisplayP3linearITUR_2020
Working with Core Foundation Types
Data Types
Instance Methods
See Also
Related Documentation
- Quartz 2D Programming Guide