Class

NSColorSpace

An object that represents a custom color spaces.

Declaration

@interface NSColorSpace : NSObject

Overview

You can make custom color spaces from ColorSync profiles or from ICC profiles. NSColorSpace also has factory methods that return objects representing the system color spaces.

You can use the colorWithColorSpace:components:count: method of the NSColor class to create color objects using custom NSColorSpace objects. You can also send the colorUsingColorSpace: message to an NSColor object to convert it between two color spaces, either of which may be a custom color space.

Topics

Getting a Named Colorspace

deviceRGBColorSpace

Returns an NSColorSpace object representing a calibrated or device-dependent RGB color space.

genericRGBColorSpace

Returns an NSColorSpace object representing a device-independent RGB color space.

deviceCMYKColorSpace

Returns an NSColorSpace object representing a calibrated or device-dependent CMYK color space.

genericCMYKColorSpace

Returns an NSColorSpace object representing a device-independent CMYK color space.

deviceGrayColorSpace

Returns an NSColorSpace object representing a calibrated or device-dependent gray color space.

genericGrayColorSpace

Returns an NSColorSpace object representing a device-independent gray color space.

sRGBColorSpace

Returns an NSColorSpace object representing an sRGB color space.

extendedSRGBColorSpace

Returns an NSColorSpace object representing an extended sRGB color space.

displayP3ColorSpace

Returns an NSColorSpace object representing a P3 Display color space.

genericGamma22GrayColorSpace

Returns an NSColorSpace object representing a gray color space with a gamma value of 2.2.

extendedGenericGamma22GrayColorSpace

Returns an NSColorSpace object representing an extended gray color space with a gamma value of 2.2.

adobeRGB1998ColorSpace

Returns an NSColorSpace object representing an Adobe RGB (1998) color space.

Getting the Color Spaces Available On the System

+ availableColorSpacesWithModel:

Returns the list of color spaces available on the system that are displayed in the color panel, in the order they are displayed in the color panel.

Initializing a Custom NSColorSpace Object

- initWithCGColorSpace:

Initializes and returns an NSColorSpace object initialized from a Core Graphics color-space object.

- initWithColorSyncProfile:

Initializes and returns an NSColorSpace object given a ColorSync profile.

- initWithICCProfileData:

Initializes and returns an NSColorSpace object given an ICC profile.

Accessing Color-Space Data and Attributes

CGColorSpace

The Core Graphics color-space object that represents a color space equivalent to the receiver’s.

colorSpaceModel

The model on which the color space of the receiver is based.

NSColorSpaceModel

The abstract model on which an color space objects are based.

colorSyncProfile

The ColorSync profile from which the receiver was created.

ICCProfileData

The ICC profile data from which the receiver was created.

localizedName

The localized name of the receiver

numberOfColorComponents

The number of components (excluding alpha) the receiver supports or zero if the receiver is not based on float components.

Relationships

Inherits From

Conforms To

See Also

Colors

NSColor

An object that stores color data and sometimes opacity (alpha value).

NSColorList

An ordered list of color objects, identified by keys.