Class

CGColorSpace

A profile that specifies how to interpret a color value for display.

Topics

Creating Color Spaces

init?(iccBasedNComponents: Int, range: UnsafePointer<CGFloat>?, profile: CGDataProvider, alternate: CGColorSpace?)

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

init?(indexedBaseSpace: CGColorSpace, last: Int, colorTable: UnsafePointer<UInt8>)

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

init?(labWhitePoint: UnsafePointer<CGFloat>, blackPoint: UnsafePointer<CGFloat>?, range: UnsafePointer<CGFloat>?)

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

init?(patternBaseSpace: CGColorSpace?)

Creates a pattern color space.

init?(iccProfileData: CFData)

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

Deprecated
init?(name: CFString)

Creates a specified type of Quartz color space.

init?(platformColorSpaceRef: UnsafeRawPointer)

Creates a platform-specific color space.

Examining a Color Space

var baseColorSpace: CGColorSpace?

Returns the base color space of a pattern or indexed color space.

var numberOfComponents: Int

Returns the number of color components in a color space.

var model: CGColorSpaceModel

Returns the color space model of the provided color space.

enum CGColorSpaceModel

Models for color spaces.

var colorTable: [UInt8]?

The entries in the color table of an indexed color space.

func copyICCData()

Returns a copy of the ICC profile data of the provided color space.

var iccData: CFData?

Returns a copy of the ICC profile of the provided color space.

Deprecated
var name: CFString?

Returns the name used to create the specified color space.

var supportsOutput: Bool

Returns a Boolean indicating whether the color space can be used as a destination color space.

var isWideGamutRGB: Bool

Returns whether the RGB color space covers a significant portion of the NTSC color gamut.

Accessing System-Defined Color Spaces

class let acescgLinear: CFString

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).

class let adobeRGB1998: CFString

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).

class let dcip3: CFString

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

class let displayP3: CFString

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.

class let extendedGray: CFString

The name of the extended Gray color space. This color space has the same colorimetry as Generic Gray 2.2, but component values below 0.0 and above 1.0 may be encoded in this color space. Negative values are encoded as the signed reflection of the original encoding function. y(x) = sign(x)*f(abs(x))

class let extendedLinearGray: CFString

The name of an extended Gray color space with a linear gamma ramp. This color space has the same colorimetry as Linear Gray, but component values below 0.0 and above 1.0 may be encoded in this color space. Negative values are encoded as the signed reflection of the original encoding function. y(x) = sign(x)*f(abs(x))

class let extendedLinearSRGB: CFString

The name of the extended linear sRGB color space. This color space has the same colorimetry as linear sRGB, but component values below 0.0 and above 1.0 may be encoded in this color space. Negative values are encoded as the signed reflection of the original encoding function. y(x) = sign(x)*f(abs(x))

class let extendedSRGB: CFString

The name of the extended sRGB color space. This color space has the same colorimetry as sRGB, but component values below 0.0 and above 1.0 may be encoded in this color space. Negative values are encoded as the signed reflection of the original encoding function. y(x) = sign(x)*f(abs(x))

class let genericCMYK: CFString

The name of the generic CMYK color space.

class let genericGrayGamma2_2: CFString

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

class let genericRGBLinear: CFString

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

class let genericXYZ: CFString

The name of the generic XYZ color space.

class let itur_2020: CFString

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).

class let itur_709: CFString

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).

class let linearGray: CFString

The name of the Gray color space using a linear gamma ramp.

class let linearSRGB: CFString

The name of the color space thats the sRGB color primaries with a linear gamma ramp.

class let rommrgb: CFString

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).

class let sRGB: CFString

The name of the sRGB color space as specified in IEC 61966-2-1.

func CGColorSpaceCreateDeviceRGB()

Creates a device-dependent RGB color space.

func CGColorSpaceCreateDeviceCMYK()

Creates a device-dependent CMYK color space.

func CGColorSpaceCreateDeviceGray()

Creates a device-dependent grayscale color space.

Working with Core Foundation Types

class var typeID: CFTypeID

Returns the Core Foundation type identifier for Quartz color spaces.

See Also

Colors and Fonts

class CGColor

A set of components that define a color, with a color space specifying how to interpret them.

class CGColorConversionInfo

An object that describes how to convert between color spaces for use by other system services.

class CGFont

A set of character glyphs and layout information for drawing text.