Inherits From:
NSResponder : NSObject
Conforms To:
NSCoding
NSCopying
NSObject (NSObject)
Declared In:
AppKit/NSColor.h
colorWith...
and colorUsing...
methods
blackColor
, blueColor
, etc.
colorUsingColorSpaceName:
| Creates an NSColor in the specified color space. |
set
| Sets the drawing color. |
set
message to an NSColor instance, you set the color for the current PostScript drawing context. This causes subsequently drawn graphics to have the color represented by the NSColor instance.
Some color spaces include an alpha component, which defines the color's opacity. An alpha value of 1.0 means completely opaque, and 0.0 means completely transparent. The alpha component is ignored when the color is used on a device that doesn't support alpha, such as a printer.
There are three kinds of color spaces in the Application Kit:
Global Variable | Color Space Description |
---|---|
NSDeviceCMYKColorSpace | Cyan, magenta, yellow, black, and alpha components |
NSDeviceWhiteColorSpace | White and alpha components |
NSDeviceBlackColorSpace | Black and alpha components |
NSDeviceRGBColorSpace | Red, green, blue, and alpha components Hue, saturation, brightness, and alpha components |
NSCalibratedWhiteColorSpace | White and alpha components |
NSCalibratedBlackColorSpace | Black and alpha components |
NSCalibratedRGBColorSpace | Red, green, blue, and alpha components Hue, saturation, brightness, and alpha components |
NSNamedColorSpace | Catalog name and color name components |
Color spaces whose names start with "NSDevice" are device-dependent; those whose names start with "NSCalibrated" are device-independent.
getRed:green:blue:alpha:
) or an individual component (using such methods as redComponent
). However, it's illegal to ask an NSColor for components that aren't defined for its color space. You can identify the color space by sending a colorSpaceName
message to the NSColor object. If you need to ask an NSColor for components that aren't in its color space (for instance, when you've gotten the color from the color panel), first convert the color to the appropriate color space using the colorUsingColorSpaceName:
method. If the color is already in the specified color space, you get the same color back; otherwise you get a conversion that's usually lossy or that's correct only for the current device. You get back nil
if the specified conversion can't be done.
colorSpaceName
and set
methods, as well as the methods that return the components for that color space and the methods in the NSCoding protocol. Some other methods-such as colorWithAlphaComponent:
, isEqual:
, and colorUsingColorSpaceName:device:
-may also be implemented if they make sense for the color space. Mutable subclasses (if any) should additionally implement copyWithZone:
to provide a true copy.
controlColor
, textColor
, and selectedTextColor
-should be used by developers who want to create custom controls or subclass existing controls which honor the user's color preferences. System colors are implemented as named colors in a special color list named "System." To extract the components of a system color, you must use NSColor's colorUsingColorSpaceName:
method to convert the color to a color space known to respond to the component accessor methods you need.An NSSystemColorsDidChangeNotification is sent when the system colors have been changed (such as through a system control panel interface). If you have any non-system colors that depend on the system colors, you can change them when you receive this notification.
blackColor
Returns an NSColor in NSCalibratedWhiteColorSpace whose grayscale value is 0.0 and whose alpha value is 1.0.
See also:
- blackComponent
blueColor
Returns an NSColor in NSCalibratedRGBColorSpace whose RGB value is 0.0, 0.0, 1.0 and whose alpha value is 1.0.
See also:
- blueComponent
brownColor
Returns an NSColor in NSCalibratedRGBColorSpace whose RGB value is 0.6, 0.4, 0.2 and whose alpha value is 1.0.
clearColor
Returns an NSColor in NSCalibratedWhiteColorSpace whose grayscale and alpha values are both 0.0.
colorFromPasteboard:
(NSPasteboard *)pasteBoard
Returns the NSColor currently on the pasteboard, or nil
if the pasteboard doesn't contain color data. The returned color's alpha component is set to 1.0 if ignoresAlpha
returns YES.
See also:
- writeToPasteboard:
colorWithCalibratedHue:
(float)huesaturation:
(float)saturationbrightness:
(float)brightnessalpha:
(float)alpha
Creates and returns an NSColor whose color space is NSCalibratedRGBColorSpace, whose opacity value is alpha, and whose components in HSB space would be hue, saturation, and brightness. (Values below 0.0 are interpreted as 0.0, and values above 1.0 are interpreted as 1.0.)
See also:
+ colorWithCalibratedRed:green:blue:alpha:
, + colorWithDeviceHue:saturation:brightness:alpha:
, - getHue:saturation:brightness:alpha:
colorWithCalibratedRed:
(float)redgreen:
(float)greenblue:
(float)bluealpha:
(float)alpha
Creates and returns an NSColor whose color space is NSCalibratedRGBColorSpace, whose opacity value is alpha, and whose RGB components are red, green, and blue. (Values below 0.0 are interpreted as 0.0, and values above 1.0 are interpreted as 1.0.)
See also:
+ colorWithCalibratedHue:saturation:brightness:alpha:
, + colorWithDeviceRed:green:blue:alpha:
, - getRed:green:blue:alpha:
colorWithCalibratedWhite:
(float)whitealpha:
(float)alpha
Creates and returns an NSColor whose color space is NSCalibratedWhiteColorSpace, whose opacity value is alpha, and whose grayscale value is white. (Values below 0.0 are interpreted as 0.0, and values above 1.0 are interpreted as 1.0.)
See also:
+ colorWithDeviceWhite:alpha:
, - getWhite:alpha:
colorWithCatalogName:
(NSString *)listName colorName:
(NSString *)colorName
Creates and returns an NSColor whose color space is NSNamedColorSpace, by finding the color named colorName in the catalog named listName, which may be a standard catalog.
See also:
- catalogNameComponent
, - colorNameComponent
, - localizedCatalogNameComponent
colorWithDeviceCyan:
(float)cyanmagenta:
(float)magentayellow:
(float)yellowblack:
(float)blackalpha:
(float)alpha
Creates and returns an NSColor whose color space is NSDeviceCMYKColorSpace, whose opacity value is alpha, and whose CMYK components are cyan, magenta, yellow, and black. (Values below 0.0 are interpreted as 0.0, and values above 1.0 are interpreted as 1.0.) In PostScript, this colorspace corresponds directly to the device-dependent operator setcmykcolor.
See also:
- getCyan:magenta:yellow:black:alpha:
colorWithDeviceHue:
(float)huesaturation:
(float)saturationbrightness:
(float)brightnessalpha:
(float)alpha
Creates and returns an NSColor whose color space is NSDeviceRGBColorSpace, whose opacity value is alpha, and whose components in HSB space would be hue, saturation, and brightness. (Values below 0.0 are interpreted as 0.0, and values above 1.0 are interpreted as 1.0.) In PostScript, this colorspace corresponds directly to the device-dependent operator setrgbcolor.
See also:
+ colorWithCalibratedHue:saturation:brightness:alpha:
, - colorWithDeviceRed:green:blue:alpha:
, - getHue:saturation:brightness:alpha:
colorWithDeviceRed:
(float)redgreen:
(float)greenblue:
(float)bluealpha:
(float)alpha
Creates and returns an NSColor whose color space is NSDeviceRGBColorSpace, whose opacity value is alpha, and whose RGB components are red, green, and blue. (Values below 0.0 are interpreted as 0.0, and values above 1.0 are interpreted as 1.0.) In PostScript, this colorspace corresponds directly to the device-dependent operator setrgbcolor.
See also:
+ colorWithCalibratedRed:green:blue:alpha:
, + colorWithDeviceHue:saturation:brightness:alpha:
, - getRed:green:blue:alpha:
colorWithDeviceWhite:
(float)whitealpha:
(float)alpha
Creates and returns an NSColor whose color space is NSDeviceWhiteColorSpace, whose opacity value is alpha, and whose grayscale value is white. (Values below 0.0 are interpreted as 0.0, and values above 1.0 are interpreted as 1.0.) In PostScript, this colorspace corresponds directly to the device-dependent operator setgray.
See also:
+ colorWithCalibratedWhite:alpha:
, - getWhite:alpha:
controlBackgroundColor
Returns the system color used for the background of large controls such as browsers, table views and clip views. By default, this color is light gray on the Macintosh, and COLOR_WINDOW on Windows. For general information on system colors, see the "System Colors" section of the class description, above.
controlColor
Returns the system color used for the flat surfaces of a control. By default, the control color is light gray on the Macintosh, and COLOR_3DFACE in Windows. A control's beveled edges, which set it in relief, are drawn in the colors returned by controlShadowColor
, controlDarkShadowColor
, controlHighlightColor
and controlLightHighlightColor
. When a control is selected-that is, clicked or dragged-it changes to the color returned by selectedControlColor
.
The return value of controlColor
is also the system color used for window backgrounds. For general information about system colors, see the "System Colors" section of the class description, above.
controlDarkShadowColor
Returns the system color used for the dark edge of the shadow dropped from controls. Controls are displayed as though they were lit from the upper left. Two dark borders, representing shadows, run along the bottom and right. controlDarkShadowColor
returns the color of the outer, darker border. By default, this color is black on the Macintosh, and COLOR_3DDKSHADOW on Windows. For general information about system colors, see the "System Colors" section of the class description, above.
See also:
+ controlShadowColor
controlHighlightColor
Returns the system color used for the highlighted bezels of controls. Controls are displayed as though they were lit from the upper left. Two light borders, representing reflections from the light source, run along the top and left. controlHighlightColor
returns the color of the inner, duller border. By default, this color is light gray on the Macintosh, and COLOR_3DLIGHT on Windows. For general information about system colors, see the "System Colors" section of the class description, above.
See also:
+ controlLightHighlightColor
controlLightHighlightColor
Returns the system color used for light highlights in controls. Controls are displayed as though they were lit from the upper left. Two light borders, representing reflections from the light source, run along the top and left. controlLightHighlightColor
returns the color of the outer, brighter border. By default, this color is white on the Macintosh, and COLOR_3DHILIGHT on Windows. For general information about system colors, see the "System Colors" section of the class description, above.
See also:
+ controlHighlightColor
controlShadowColor
Returns the system color used for the shadows dropped from controls. Controls are displayed as though they were lit from the upper left. Two dark borders, representing shadows, run along the bottom and right. controlShadowColor
returns the color of the inner, lighter border. By default, this color is dark gray on the Macintosh, and COLOR_3DSHADOW on Windows. For general information about system colors, see the "System Colors" section of the class description, above.
See also:
+ controlDarkShadowColor
controlTextColor
Returns the system color used for text on controls that aren't disabled. By default, the text color is black on the Macintosh, and COLOR_BTNTEXT on Windows. For general information about system colors, see the "System Colors" section of the class description, above.
See also:
+ disabledControlTextColor
cyanColor
Returns an NSColor in NSCalibratedRGBColorSpace whose RGB value is 0.0, 1.0, 1.0 and whose alpha value is 1.0.
See also:
- cyanComponent
darkGrayColor
Returns an NSColor in NSCalibratedWhiteColorSpace whose grayscale value is 1/3 and whose alpha value is 1.0.
See also:
+ lightGrayColor
, + grayColor
disabledControlTextColor
Returns the system color used for text on disabled controls. By default, the text color is dark gray on the Macintosh, and COLOR_3DSHADOW on Windows. For general information about system colors, see the "System Colors" section of the class description, above.
See also:
+ controlTextColor
grayColor
Returns an NSColor in NSCalibratedWhiteColorSpace whose grayscale value is 0.5 and whose alpha value is 1.0.
See also:
+ lightGrayColor
, + darkGrayColor
greenColor
Returns an NSColor in NSCalibratedRGBColorSpace whose RGB value is 0.0, 1.0, 0.0 and whose alpha value is 1.0.
See also:
- greenComponent
gridColor
Returns the system color used for the optional gridlines in, for example, a table view. By default, this color is gray on the Macintosh, and COLOR_3DFACE on Windows. For general information about system colors, see the "System Colors" section of the class description, above.
highlightColor
Returns the system color that represents the virtual light source on the screen. By default, this color is white on the Macintosh, and COLOR_3DHILIGHT on Windows. This method is invoked by the highlightWithLevel:
method. For general information about system colors, see the "System Colors" section of the class description, above.
See also:
- highlightWithLevel:
ignoresAlpha
Returns YES if the application doesn't support alpha. This value returned is consulted when an application imports alpha (through color dragging, for instance). The value determines whether the color panel has an opacity slider. This value is YES by default, indicating that the opacity components of imported colors will be set to 1.0. If an application wants alpha, it can invoke the setIgnoresAlpha
method with a parameter of NO.
See also:
+ setIgnoresAlpha:
, - alphaComponent
knobColor
Returns the system color used for the flat surface of a slider knob that hasn't been selected. By default, this color is light blue on the Macintosh, and COLOR_3DFACE on Windows. The knob's beveled edges, which set it in relief, are drawn in highlighted and shadowed versions of the face color. When a knob is selected, its color changes to selectedKnobColor
. For general information about system colors, see the "System Colors" section of the class description, above.
lightGrayColor
Returns an NSColor in NSCalibratedWhiteColorSpace whose grayscale value is 2/3 and whose alpha value is 1.0.
See also:
+ grayColor
, + darkGrayColor
magentaColor
Returns an NSColor in NSCalibratedRGBColorSpace whose RGB value is 1.0, 0.0, 1.0 and whose alpha value is 1.0.
See also:
- magentaComponent
orangeColor
Returns an NSColor in NSCalibratedRGBColorSpace whose RGB value is 1.0, 0.5, 0.0 and whose alpha value is 1.0.
purpleColor
Returns an NSColor in NSCalibratedRGBColorSpace whose RGB value is 0.5, 0.0, 0.5 and whose alpha value is 1.0.
redColor
Returns an NSColor in NSCalibratedRGBColorSpace whose RGB value is 1.0, 0.0, 0.0 and whose alpha value is 1.0.
See also:
- redComponent
scrollBarColor
Returns the system color used for scroll "bars"-that is, for the groove in which a scroller's knob moves. By default, this color is gray on the Macintosh, and COLOR_SCROLLBAR on Windows. On Windows, when a scroll bar is dragged, its color changes to the return value of selectedControlColor
; on the Macintosh, however, its color does not change. For general information about system colors, see the "System Colors" section of the class description, above.
selectedControlColor
Returns the system color used for the face of a selected control-that is a control being clicked or dragged. By default, this color is white on the Macintosh, and COLOR_HIGHLIGHT on Windows. For general information about system colors, see the "System Colors" section of the class description, above.
See also:
+ selectedControlTextColor
selectedControlTextColor
Returns the system color used for text in a selected control-that is a control being clicked or dragged. By default, this color is black on the Macintosh, and COLOR_HIGHLIGHTTEXT on Windows. For general information about system colors, see the "System Colors" section of the class description, above.
See also:
+ selectedControlColor
selectedKnobColor
Returns the system color used for the slider knob when it is selected-that is, dragged. By default, this color is light blue on the Macintosh, and COLOR_HIGHLIGHT on Windows. For general information about system colors, see the "System Colors" section of the class description, above.
See also:
+ knobColor
selectedMenuItemColor
Returns the system color used for the face of selected menu items. By default, this color is white on the Macintosh, and COLOR_HIGHLIGHT on Windows. For general information about system colors, see the "System Colors" section of the class description, above.
See also:
+ selectedMenuItemTextColor
selectedMenuItemTextColor
Returns the system color used for the text in menu items. By default, this color is black on the Macintosh, and COLOR_HIGHLIGHTTEXT on Windows. For general information about system colors, see the "System Colors" section of the class description, above.
See also:
+ selectedMenuItemColor
selectedTextBackgroundColor
Returns the system color used for the background of selected text. By default, this color is light gray on the Macintosh, and COLOR_HIGHLIGHT on Windows. For general information about system colors, see the "System Colors" section of the class description, above.
See also:
+ selectedTextColor
selectedTextColor
Returns the system color used for selected text. By default, this color is black on the Macintosh, and COLOR_HIGHLIGHTTEXT on Windows. For general information about system colors, see the "System Colors" section of the class description, above.
See also:
+ selectedTextBackgroundColor
setIgnoresAlpha:
(BOOL)flag
If flag is YES, The application won't support alpha. In this case, no opacity slider is displayed in the color panel, and colors dragged in or pasted have their alpha values set to 1.0. Applications which need to import alpha can invoke this method with flag set to NO and explicitly make colors opaque in cases where it matters to them.
See also:
+ ignoresAlpha
, - alphaComponent
shadowColor
Returns the system color that represents the virtual shadows cast by raised objects on the screen. This method is invoked by shadowWithLevel:
. By default, the color it returns is black on the Macintosh, and COLOR_3DDKSHADOW on Windows. For general information about system colors, see the "System Colors" section of the class description, above.
See also:
- shadowWithLevel:
textBackgroundColor
Returns the system color used for the text background. By default, this color is white on the Macintosh, and COLOR_WINDOW on Windows. When text is selected, its background color changes to the return value of selectedTextBackgroundColor
. For general information about system colors, see the "System Colors" section of the class description, above.
See also:
+ textColor
textColor
Returns the system color used for text. By default, this color is black on the Macintosh, and COLOR_WINDOWTEXT on Windows. When text is selected, its background color changes to the return value of selectedTextColor
. For general information about system colors, see the "System Colors" section of the class description, above.
See also:
+ textBackgroundColor
whiteColor
Returns an NSColor in NSCalibratedWhiteColorSpace whose grayscale and alpha values are both 1.0.
See also:
- whiteComponent
windowFrameColor
Returns the system color used for window frames, except for their text. By default, this color is gray on the Macintosh, and COLOR_ACTIVEBORDER on Windows. For general information about system colors, see the "System Colors" section of the class description, above.
See also:
+ windowFrameTextColor
windowFrameTextColor
Returns the system color used for the text in window frames. By default, this color is black on the Macintosh, and COLOR_CAPTIONTEXT on Windows. For general information about system colors, see the "System Colors" section of the class description, above.
See also:
+ windowFrameColor
yellowColor
Returns an NSColor in NSCalibratedRGBColorSpace whose RGB value is 1.0, 1.0, 0.0 and whose alpha value is 1.0.
See also:
- yellowComponent
alphaComponent
Returns the receiver's alpha (opacity) component. Returns 1.0 (opaque) if the receiver has no alpha component.
See also:
- getCyan:magenta:yellow:black:alpha:
, - getHue:saturation:brightness:alpha:
,
- getRed:green:blue:alpha:
, - getWhite:alpha:
blackComponent
Returns the receiver's black component. Raises an exception if the receiver isn't a CMYK color.
See also:
- getCyan:magenta:yellow:black:alpha:
blendedColorWithFraction:
(float)fractionofColor:
(NSColor *)color
Creates and returns an NSColor in NSCalibratedRGBColorSpace whose component values are a weighted sum of the receiver's and color's. The method converts color and a copy of the receiver to RGB, and then sets each component of the returned color to fraction of color's value plus 1 - fraction of the receiver's. Returns nil
if the colors can't be converted to NSCalibratedRGBColorSpace.
blueComponent
Returns the receiver's blue component. Raises an exception if the receiver isn't an RGB color.
See also:
- getRed:green:blue:alpha:
brightnessComponent
Returns the brightness component of the HSB color equivalent to the receiver. Raises an exception if the receiver isn't an RGB color.
See also:
- getHue:saturation:brightness:alpha:
catalogNameComponent
Returns the name of the catalog containing the receiver's name, or raises an exception if the receiver's color space isn't NSNamedColorSpace.
See also:
+ colorWithCatalogName:colorName:
, - colorNameComponent
,
- localizedCatalogNameComponent
colorNameComponent
Returns the receiver's name, or raises an exception if the receiver's color space isn't NSNamedColorSpace.
See also:
+ colorWithCatalogName:colorName:
, - catalogNameComponent
,
- localizedCatalogNameComponent
colorSpaceName
Returns the name of the receiver's color space. This method should be implemented in subclasses of NSColor.
See also:
- colorUsingColorSpaceName:
, - colorUsingColorSpaceName:device:
colorUsingColorSpaceName:
(NSString *)colorSpace
Creates and returns an NSColor whose color is the same as the receiver's, except that the new NSColor is in the color space named colorSpace. If colorSpace is nil
, the most appropriate color space is used.
Returns nil
if the specified conversion cannot be done.
See also:
- colorSpaceName
colorUsingColorSpaceName:
(NSString *)colorSpacedevice:
(NSDictionary *)deviceDescription
Creates and returns an NSColor whose color is the same as the receiver's, except that the new NSColor is in the color space named colorSpace and is specific to the device described by deviceDescription. Device descriptions can be obtained from windows, screens, and printers with the deviceDescription
method. If colorSpace is nil
, the most appropriate color space is used.
If deviceDescription is nil,
the current device (as obtained from the currently lockFocus'ed view's window or, if printing, the current printer) is used.
Returns nil
if the specified conversion cannot be done.
See also:
- colorSpaceName
, - colorUsingColorSpaceName:
colorWithAlphaComponent:
(float)alpha
Creates and returns an NSColor that has the same color space and component values as the receiver, except that its alpha component is alpha. If the receiver's color space doesn't include an alpha component, the receiver is returned. A subclass which has explicit opacity components should override this method to return a color with the specified alpha.
See also:
- alphaComponent
, - blendedColorWithFraction:ofColor:
cyanComponent
Returns the receiver's cyan component. Raises an exception if the receiver isn't a CMYK color.
See also:
- getCyan:magenta:yellow:black:alpha:
drawSwatchInRect:
(NSRect)rect
Draws the current color in the rectangle rect. Subclasses adorn the rectangle in some manner to indicate the type of color. This method is invoked by color wells, swatches, and other user-interface objects that need to display colors.
getCyan:
(float *)cyanmagenta:
(float *)magentayellow:
(float *)yellowblack:
(float *)blackalpha:
(float *)alpha
Returns the receiver's CMYK and alpha values in the respective arguments. If NULL
is passed in as an argument, the method doesn't set that value. Raises an exception if the receiver isn't a CMYK color.
See also:
- alphaComponent
, - blackComponent
, - cyanComponent
, - magentaComponent
,
- yellowComponent
getHue:
(float *)huesaturation:
(float *)saturationbrightness:
(float *)brightnessalpha:
(float *)alpha
Returns the receiver's HSB and alpha values in the respective arguments. If NULL is passed in as an argument, the method doesn't set that value. Raises an exception if the receiver isn't an RGB color.
See also:
- alphaComponent
, - brightnessComponent
, - hueComponent
, - saturationComponent
getRed:
(float *)redgreen:
(float *)greenblue:
(float *)bluealpha:
(float *)alpha
Returns the receiver's RGB and alpha values in the respective arguments. If NULL
is passed in as an argument, the method doesn't set that value. Raises an exception if the receiver isn't an RGB color.
See also:
- alphaComponent
, - blueComponent
, - greenComponent
, - redComponent
getWhite:
(float *)whitealpha:
(float *)alpha
Returns the receiver's grayscale and alpha values in the respective arguments. If NULL is passed in as an argument, the method doesn't set that value. Raises an exception if the receiver isn't a grayscale color.
See also:
- alphaComponent
, - whiteComponent
greenComponent
Returns the receiver's green component. Raises an exception if the receiver isn't an RGB color.
See also:
- getRed:green:blue:alpha:
highlightWithLevel:
(float)highlightLevel
Returns an NSColor in NSCalibratedRGBColorSpace that represents a blend between the receiver and the highlight color-that is, the NSColor returned by highlightColor
. The highlight color's contribution to the blend depends on highlightLevel, which should be a number between 0.0 and 1.0. (A highlightLevel below 0.0 is interpreted as 0.0; a highlightLevel above 1.0 is interpreted as 1.0.)
Returns nil
if the colors can't be converted to NSCalibratedRGBColorSpace. Invoke this method when you want to brighten the receiving NSColor for use in highlights.
See also:
- shadowWithLevel:
hueComponent
Returns the hue component of the HSB color equivalent to the receiver. Raises an exception if the receiver isn't an RGB color.
See also:
- getHue:saturation:brightness:alpha:
localizedCatalogNameComponent
Like catalogNameComponent
, but returns a localized string. This string may be displayed in user-interface items like color pickers.
See also:
+ colorWithCatalogName:colorName:
, - colorNameComponent
localizedColorNameComponent
Like colorNameComponent
, but returns a localized string. This string may be displayed in user-interface items like color pickers.
See also:
+ colorWithCatalogName:colorName:
, - catalogNameComponent
,
- colorNameComponent
, - localizedCatalogNameComponent
magentaComponent
Returns the receiver's magenta component. Raises an exception if the receiver isn't a CMYK color.
See also:
- getCyan:magenta:yellow:black:alpha:
redComponent
Returns the receiver's red component. Raises an exception if the receiver isn't an RGB color.
See also:
- getRed:green:blue:alpha:
saturationComponent
Returns the saturation component of the HSB color equivalent to the receiver. Raises an exception if the receiver isn't an RGB color.
See also:
- getHue:saturation:brightness:alpha:
set
Sets the color of subsequent PostScript drawing to the color that the receiver represents. If the application is drawing to the screen rather than printing, this method also sets the current drawing context's alpha value to the value returned by alphaComponent
; if the color doesn't know about alpha, it's set to 1.0. This method should be implemented in subclasses.
shadowWithLevel:
(float)shadowLevel
Returns an NSColor in NSCalibratedRGBColorSpace that represents a blend between the receiver and the shadow color-that is, the NSColor returned by shadowColor
. The shadow color's contribution to the blend depends on shadowLevel, which should be a number between 0.0 and 1.0. (A shadowLevel below 0.0 is interpreted as 0.0; a shadowLevel above 1.0 is interpreted as 1.0.)
Returns nil
if the colors can't be converted to NSCalibratedRGBColorSpace. Invoke this method when you want to darken the receiving NSColor for use in shadows.
See also:
- highlightWithLevel:
whiteComponent
Returns the receiver's white component. Raises an exception if the receiver isn't a grayscale color.
See also:
- getWhite:alpha:
writeToPasteboard:
(NSPasteboard *)pasteBoard
Writes the receiver's data to the pasteboard, unless the pasteboard doesn't support color data (in which case the method does nothing).
See also:
+ colorFromPasteboard:
yellowComponent
Returns the receiver's yellow component. Raises an exception if the receiver isn't a CMYK color.
See also:
- getCyan:magenta:yellow:black:alpha:
This notification contains no notification object and no userInfo dictionary.