Important: The information in this document is obsolete and should not be used for new development.
Inherits from | |
Implements | |
Package | com.apple.cocoa.application |
Availability | Available in Mac OS X v10.4 and later. |
Companion guide |
The NSColorSpace class enables the creation of objects representing custom color spaces. 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 send the colorUsingColorSpace
message to an NSColor object to convert it between two color spaces, either of which may be a custom color space.
deviceRGBColorSpace
genericRGBColorSpace
deviceCMYKColorSpace
genericCMYKColorSpace
deviceGrayColorSpace
genericGrayColorSpace
public NSColorSpace
()
Creates an NSColorSpace object.
Creates an NSColorSpace object initialized with the ICC profile in iccData.
NSColorSpace
(NSData iccData)
For information on ICC profiles, see the latest ICC specification at the International Color Consortium website (http://www.color.org/icc_specs2.html)
Returns an NSColorSpace object representing a calibrated or device-dependent CMYK color space.
public static NSColorSpace deviceCMYKColorSpace
()
This color space has cyan, magenta, yellow, black, and alpha components. Typical devices that use the color-subtractive CMYK color space are color printers. This object corresponds to the Cocoa color space name DeviceCMYKColorSpace
.
Returns an NSColorSpace object representing a calibrated or device-dependent gray-scale color space.
public static NSColorSpace deviceGrayColorSpace
()
The color space also includes an alpha component. Typical devices that use this color space are grayscale printers and displays. This object corresponds to the Cocoa color space name DeviceWhiteColorSpace
.
Returns an NSColorSpace object representing a calibrated or device-dependent RGB color space.
public static NSColorSpace deviceRGBColorSpace
()
This color space has red, green, blue, and alpha components. Typical devices that use the color-additive RGB color space are displays and scanners. This object corresponds to the Cocoa color space name DeviceRGBColorSpace
.
Returns an NSColorSpace object representing a device-independent CMYK color space.
public static NSColorSpace genericCMYKColorSpace
()
This color space has cyan, magenta, yellow, black and alpha component.
Returns an NSColorSpace object representing a device-independent grayscale color space.
public static NSColorSpace genericGrayColorSpace
()
The color space also includes an alpha component. This object corresponds to the Cocoa color space name CalibratedWhiteColorSpace
.
Returns an NSColorSpace object representing a device-independent RGB grayscale.
public static NSColorSpace genericRGBColorSpace
()
This color-additive color space has red, green, blue, and alpha components. This object corresponds to the Cocoa color space name CalibratedRGBColorSpace
.
Returns the model on which the color space of the receiver is based.
public int colorSpaceModel()
See “Constants” for a list of valid NSColorSpaceModel constants.
Returns the ICC profile data from which the receiver was created.
public native NSData ICCProfileData
()
This method attempts to compute the profile data from a CMProfileRef object and returns null
if it is unable to. For information on ICC profiles, see the latest ICC specification at the International Color Consortium website (http://www.color.org/icc_specs2.html).
Returns the localized name of the receiver.
public String localizedName
()
Returns null
if no localized name exists.
Returns the number of components (excluding alpha) supported by the receiver.
public int numberOfColorComponents
()
Returns zero if the receiver is not based on float
components.
The following constants indentify the abstract model on which an NSColorSpace object is based. This constant is returned from colorSpaceModel
and is derived from the profile data encapsulated by the object.
© 1997, 2007 Apple Inc. All Rights Reserved. (Last updated: 2007-02-01)