Up
Authors
- Scott Christley (
scottc@net-community.com)
-
- Fred Kiefer (
fredkiefer@gmx.de)
-
Date: Generated at 2025-12-03
The colorful color class
Copyright: (C)
1996, 1998, 2001, 2002 Free Software Foundation, Inc.
- Declared in:
- AppKit/NSColor.h
- Conforms to:
- NSCoding
- NSCopying
Availability: OpenStep
NSColor provides a powerful and flexible system for
representing and manipulating colors across
different color spaces and devices. As an abstract
superclass of a class cluster, NSColor supports
multiple color models including RGB, HSB, CMYK,
grayscale, and catalog-based colors. Key features
include: * Multiple color space support (calibrated,
device-dependent, generic) *
Component-based color creation with precise
control * Comprehensive set of predefined system and
standard colors * Color space conversion and
device-specific adaptation * Pattern-based
colors using images * System appearance integration
with dynamic colors * Pasteboard integration for color
copying and pasting * Advanced color manipulation
(blending, highlighting, shadowing) * Support for
alpha transparency and composition NSColor
automatically handles color space conversions
and provides optimized representations for different
rendering contexts. The class integrates seamlessly
with the graphics system and supports both programmatic
color creation and system-provided appearance colors
that adapt to user preferences. Color spaces
NSDeviceBlackColorSpace and
NSCalibratedBlackColorSpace are
treated as synonyms for their white counterparts for
compatibility.
TODO NSColor description
+ (
NSColor*)
alternateSelectedControlColor;
Availability: MacOS-X 10.2.0
Returns the alternate selected control color for
alternating row backgrounds. Returns: An
NSColor for alternate selection highlighting
+ (
NSColor*)
alternateSelectedControlTextColor;
Availability: MacOS-X 10.2.0
Returns the text color for alternate selected
controls. Returns: An NSColor for text in
alternate selected controls
+ (
NSColor*)
blackColor;
Availability: OpenStep
Returns a black color (0.0, 0.0, 0.0, 1.0 in RGB).
Returns: A black NSColor instance
Returns a NSColor in a
NSCalibratedWhiteColorSpace
space name. with white and alpha values set as
NSBlack and 1.0 respectively.
See Also :
+colorWithCalibratedWhite:alpha:
+ (
NSColor*)
blueColor;
Availability: OpenStep
Returns a blue color (0.0, 0.0, 1.0, 1.0 in RGB).
Returns: A blue NSColor instance
Returns an NSColor in a NSCalibratedRGBColorSpace
space name. with red, green, blue and alpha values
set as 0.0, 0.0, 1.0 and 1.0 respectively.
See Also :
+colorWithCalibratedRed:green:blue:alpha:
+ (
NSColor*)
brownColor;
Availability: OpenStep
Returns a brown color (0.6, 0.4, 0.2, 1.0 in RGB).
Returns: A brown NSColor instance
Returns a NSColor in a NSCalibratedRGBColorSpace
space name. with red, green, blue and alpha values
set as 0.6, 0.4, 0.2 and 1.0 respectively.
See Also:
+colorWithCalibratedRed:green:blue:alpha:
+ (
NSColor*)
clearColor;
Availability: OpenStep
Returns a clear color (0.0, 0.0, 0.0, 0.0 in RGB).
Returns: A completely transparent NSColor instance
Returns a NSColor in a
NSCalibratedWhiteColorSpace
space name. with white and alpha values set as 0.0
and 1.0 respectively.
See Also :
+colorWithCalibratedWhite:alpha:
+ (
NSColor*)
colorForControlTint: (
NSControlTint)controlTint;
Availability: MacOS-X 10.0.0
Returns the color appropriate for the specified
control tint. controlTint: The control tint (blue,
graphite, etc.) Returns: An NSColor matching the
control tint preference
+ (
NSColor*)
colorFromPasteboard: (
NSPasteboard*)pasteBoard;
Availability: OpenStep
Creates a color from color data on the pasteboard.
pasteBoard: The pasteboard to read color data
from Returns: A new NSColor from the pasteboard data,
or
nil if no valid color data
Returns the NSColor on the NSPasteboard
pasteBoard or nil if it
does not exists.
See Also:
-writeToPasteboard:
+ (
NSColor*)
colorWithCalibratedHue: (CGFloat)hue
saturation: (CGFloat)saturation
brightness: (CGFloat)brightness
alpha: (CGFloat)alpha;
Availability: OpenStep
Creates a color in the calibrated HSB color space.
hue: The
hue component (0.0 to 1.0)
saturation: The
saturation component
(0.0 to 1.0) brightness: The
brightness
component (0.0 to 1.0) alpha: The
alpha transparency component (0.0 to 1.0)
Returns: A new NSColor instance in calibrated HSB
color space
Creates and returns a new NSColor in a
NSCalibratedRGBColorSpace space
name, with hue, saturation,
brightness and alpha as
specified. Valid values are the range 0.0 to
1.0. Out of range values will be clipped.
+ (
NSColor*)
colorWithCalibratedRed: (CGFloat)red
green: (CGFloat)green
blue: (CGFloat)blue
alpha: (CGFloat)alpha;
Availability: OpenStep
Creates a color in the calibrated RGB color space.
red: The
red component (0.0 to 1.0) green:
The
green component (0.0 to 1.0) blue: The
blue component (0.0 to 1.0) alpha: The
alpha transparency component (0.0 to 1.0)
Returns: A new NSColor instance in calibrated RGB
color space
Creates and returns a new NSColor in a
NSCalibratedRGBColorSpace space
name, with red, green,
blue and alpha as specified.
Valid values are the range 0.0 to 1.0. Out of range
values will be clipped.
+ (
NSColor*)
colorWithCalibratedWhite: (CGFloat)white
alpha: (CGFloat)alpha;
Availability: OpenStep
Creates a grayscale color in the calibrated
white color space. white: The grayscale
value (0.0 for black to 1.0 for
white)
alpha: The
alpha transparency component
(0.0 to 1.0) Returns: A new NSColor instance in
calibrated
white color space
Creates and returns a new NSColor in a
NSCalibratedWhiteColorSpace
space name, with red, green, blue and
alpha as specified. Valid values are the
range 0.0 to 1.0. Out of range values will be
clipped.
+ (
NSColor*)
colorWithCatalogName: (
NSString*)listName
colorName: (
NSString*)colorName;
Availability: OpenStep
Creates a color from a color catalog. listName: The
name of the color catalog colorName: The name of the
color within the catalog Returns: A new NSColor
instance from the specified catalog, or
nil if not found
TODO
+ (
NSColor*)
colorWithColorSpace: (
NSColorSpace*)space
components: (const CGFloat*)comp
count: (
NSInteger)number;
Availability: MacOS-X 10.4.0
Creates a color with the specified color
space and component values. space: The
NSColorSpace to use comp: Array of component
values number: Number of components in the array
Returns: A new NSColor instance in the specified
color space
+ (
NSColor*)
colorWithColorSpace: (
NSColorSpace*)space
hue: (CGFloat)hue
saturation: (CGFloat)saturation
brightness: (CGFloat)brightness
alpha: (CGFloat)alpha;
Availability: MacOS-X 10.12.0
Description forthcoming.
+ (
NSColor*)
colorWithDeviceCyan: (CGFloat)cyan
magenta: (CGFloat)magenta
yellow: (CGFloat)yellow
black: (CGFloat)black
alpha: (CGFloat)alpha;
Availability: OpenStep
Creates a color in the device CMYK color space.
cyan: The
cyan component (0.0 to 1.0)
magenta: The
magenta component (0.0 to
1.0) yellow: The
yellow component (0.0 to
1.0) black: The
black component (0.0 to
1.0) alpha: The
alpha transparency
component (0.0 to 1.0) Returns: A new NSColor
instance in device CMYK color space
Creates and returns a new NSColor in a
NSDeviceCMYKColorSpace space name,
with cyan, magenta,
yellow, black and
alpha as specified. Valid values are the
range 0.0 to 1.0. Out of range values will be
clipped.
+ (
NSColor*)
colorWithDeviceHue: (CGFloat)hue
saturation: (CGFloat)saturation
brightness: (CGFloat)brightness
alpha: (CGFloat)alpha;
Availability: OpenStep
Creates a color in the device HSB color space. hue:
The
hue component (0.0 to 1.0) saturation:
The
saturation component (0.0 to 1.0)
brightness: The
brightness component
(0.0 to 1.0) alpha: The
alpha transparency
component (0.0 to 1.0) Returns: A new NSColor
instance in device HSB color space
Creates and returns a new NSColor in a
NSDeviceCMYKColorSpace space name,
with hue, saturation,
brightness and alpha as
specified. Valid values are the range 0.0 to
1.0. Out of range values will be clipped.
+ (
NSColor*)
colorWithDeviceRed: (CGFloat)red
green: (CGFloat)green
blue: (CGFloat)blue
alpha: (CGFloat)alpha;
Availability: OpenStep
Creates a color in the device RGB color space. red:
The
red component (0.0 to 1.0) green: The
green component (0.0 to 1.0) blue: The
blue component (0.0 to 1.0) alpha: The
alpha transparency component (0.0 to 1.0)
Returns: A new NSColor instance in device RGB
color space
Creates and returns a new NSColor in a
NSDeviceCMYKColorSpace space name,
with red, green,
blue and alpha as specified.
Valid values are the range 0.0 to 1.0. Out of range
values will be clipped.
+ (
NSColor*)
colorWithDeviceWhite: (CGFloat)white
alpha: (CGFloat)alpha;
Availability: OpenStep
Creates a grayscale color in the device
white color space. white: The grayscale
value (0.0 for black to 1.0 for
white)
alpha: The
alpha transparency component
(0.0 to 1.0) Returns: A new NSColor instance in device
white color space
Creates and returns a new NSColor in a
NSDeviceWhiteColorSpace space
name, with red, green, blue and alpha as
specified. Valid values are the range 0.0 to
1.0. Out of range values will be clipped.
+ (
NSColor*)
colorWithDisplayP3Red: (CGFloat)red
green: (CGFloat)green
blue: (CGFloat)blue
alpha: (CGFloat)alpha;
Availability: MacOS-X 10.12.0
Description forthcoming.
+ (
NSColor*)
colorWithGenericGamma22White: (CGFloat)white
alpha: (CGFloat)alpha;
Availability: MacOS-X 10.7.0
Description forthcoming.
+ (
NSColor*)
colorWithHue: (CGFloat)hue
saturation: (CGFloat)saturation
brightness: (CGFloat)brightness
alpha: (CGFloat)alpha;
Availability: MacOS-X 10.9.0
Description forthcoming.
+ (
NSColor*)
colorWithPatternImage: (
NSImage*)image;
Availability: MacOS-X 10.0.0
Creates a pattern color using the specified
image. image: The image to use
as the pattern Returns: A new NSColor that draws the
image as a repeating pattern
+ (
NSColor*)
colorWithRed: (CGFloat)red
green: (CGFloat)green
blue: (CGFloat)blue
alpha: (CGFloat)alpha;
Availability: MacOS-X 10.9.0
Description forthcoming.
+ (
NSColor*)
colorWithSRGBRed: (CGFloat)red
green: (CGFloat)green
blue: (CGFloat)blue
alpha: (CGFloat)alpha;
Availability: MacOS-X 10.7.0
Description forthcoming.
+ (
NSColor*)
colorWithWhite: (CGFloat)white
alpha: (CGFloat)alpha;
Availability: MacOS-X 10.9.0
Description forthcoming.
+ (
NSArray*)
controlAlternatingRowBackgroundColors;
Availability: MacOS-X 10.3.0
Description forthcoming.
+ (
NSColor*)
controlBackgroundColor;
Availability: MacOS-X 10.0.0
Returns the background color for controls. Returns:
An NSColor for control backgrounds
+ (
NSColor*)
controlColor;
Availability: MacOS-X 10.0.0
Returns the standard control color. Returns: An
NSColor for standard control appearance
+ (
NSColor*)
controlDarkShadowColor;
Availability: MacOS-X 10.0.0
Returns the dark shadow color for controls.
Returns: An NSColor for dark control shadows
+ (
NSColor*)
controlHighlightColor;
Availability: MacOS-X 10.0.0
Returns the highlight color for controls. Returns:
An NSColor for control highlighting
+ (
NSColor*)
controlLightHighlightColor;
Availability: MacOS-X 10.0.0
Returns the light highlight color for controls.
Returns: An NSColor for light control highlighting
+ (
NSColor*)
controlShadowColor;
Availability: MacOS-X 10.0.0
Returns the shadow color for controls. Returns: An
NSColor for control shadows
+ (
NSColor*)
controlTextColor;
Availability: MacOS-X 10.0.0
Returns the text color for controls. Returns: An
NSColor for control text
+ (
NSControlTint)
currentControlTint;
Availability: MacOS-X 10.3.0
Returns the current control tint preference.
Returns: The NSControlTint value representing the
user's preference
+ (
NSColor*)
cyanColor;
Availability: OpenStep
Returns a cyan color (0.0, 1.0, 1.0, 1.0 in RGB).
Returns: A cyan NSColor instance
Returns a NSColor in a NSCalibratedRGBColorSpace
space name. with red, green, blue and alpha values
set as 0.0, 1.0, 1.0 and 1.0 respectively.
See Also :
+colorWithCalibratedRed:green:blue:alpha:
+ (
NSColor*)
darkGrayColor;
Availability: OpenStep
Returns a dark gray color (0.33, 0.33, 0.33, 1.0 in
RGB). Returns: A dark gray NSColor instance
Returns a NSColor in a
NSCalibratedWhiteColorSpace
space name. with white and alpha values set as
NSDarkGray and 1.0 respectively.
See Also :
+colorWithCalibratedWhite:alpha:
+ (
NSColor*)
disabledControlTextColor;
Availability: MacOS-X 10.0.0
Returns the text color for disabled controls.
Returns: An NSColor for disabled control text
+ (
NSColor*)
grayColor;
Availability: OpenStep
Returns a medium gray color (0.5, 0.5, 0.5, 1.0 in
RGB). Returns: A gray NSColor instance
Returns a NSColor in a
NSCalibratedWhiteColorSpace
space name. with white and alpha values set as
NSGray and 1.0 respectively.
See Also:
+colorWithCalibratedWhite:alpha:
+ (
NSColor*)
greenColor;
Availability: OpenStep
Returns a green color (0.0, 1.0, 0.0, 1.0 in RGB).
Returns: A green NSColor instance
Returns a NSColor in a NSCalibratedRGBColorSpace
space name. with red, green, blue and alpha values
set as 0.0, 1.0, 0.0 and 1.0 respectively
See Also:
+colorWithCalibratedRed:green:blue:alpha:
+ (
NSColor*)
gridColor;
Availability: MacOS-X 10.0.0
Returns the color for grid lines. Returns: An
NSColor for drawing grid lines
+ (
NSColor*)
headerColor;
Availability: MacOS-X 10.0.0
Returns the color for header backgrounds. Returns:
An NSColor for header backgrounds
+ (
NSColor*)
headerTextColor;
Availability: MacOS-X 10.0.0
Returns the text color for headers. Returns: An
NSColor for header text
+ (
NSColor*)
highlightColor;
Availability: MacOS-X 10.0.0
Returns the general highlight color. Returns: An
NSColor for general highlighting
+ (BOOL)
ignoresAlpha;
Availability: OpenStep
Returns whether alpha components are ignored in
color operations. Returns:
YES if alpha
components are ignored,
NO if they
are used
Returns whether TODO
See Also:
+setIgnoresAlpha:
+ (
NSColor*)
keyboardFocusIndicatorColor;
Availability: MacOS-X 10.0.0
Returns the keyboard focus indicator color.
Returns: An NSColor for keyboard focus indicators
+ (
NSColor*)
knobColor;
Availability: MacOS-X 10.0.0
Returns the color for control knobs. Returns: An
NSColor for control knobs (sliders, etc.)
+ (
NSColor*)
labelColor;
Availability: MacOS-X 10.10.0
Description forthcoming.
+ (
NSColor*)
lightGrayColor;
Availability: OpenStep
Returns a light gray color (0.67, 0.67, 0.67, 1.0
in RGB). Returns: A light gray NSColor instance
Returns a NSColor in a
NSCalibratedWhiteColorSpace
space name. with white and alpha values set as
NSLightGray and 1.0 respectively
See Also :
+colorWithCalibratedRed:green:blue:alpha:
+ (
NSColor*)
magentaColor;
Availability: OpenStep
Returns a magenta color (1.0, 0.0, 1.0, 1.0 in
RGB). Returns: A magenta NSColor instance
Returns a NSColor in a NSCalibratedRGBColorSpace
space name. with red, green, blue and alpha values
set as 1.0, 0.0, 1.0 and 1.0 respectively.
See Also :
+colorWithCalibratedRed:green:blue:alpha:
+ (
NSColor*)
orangeColor;
Availability: OpenStep
Returns an orange color (1.0, 0.5, 0.0, 1.0 in
RGB). Returns: An orange NSColor instance
Returns a NSColor in a NSCalibratedRGBColorSpace
space name. with red, green, blue and alpha values
set as 1.0, 0.5, 0.0 and 1.0 respectively.
See Also:
+colorWithCalibratedRed:green:blue:alpha:
+ (
NSColor*)
purpleColor;
Availability: OpenStep
Returns a purple color (0.5, 0.0, 0.5, 1.0 in RGB).
Returns: A purple NSColor instance
Returns a NSColor in a NSCalibratedRGBColorSpace
space name. with red, green, blue and alpha values
set as 0.5, 0.0, 0.5 and 1.0 respectively.
See Also :
+colorWithCalibratedRed:green:blue:alpha:
+ (
NSColor*)
quaternaryLabelColor;
Availability: MacOS-X 10.10.0
Description forthcoming.
+ (
NSColor*)
redColor;
Availability: OpenStep
Returns a red color (1.0, 0.0, 0.0, 1.0 in RGB).
Returns: A red NSColor instance
Returns a NSColor in a NSCalibratedRGBColorSpace
space name. with red, green, blue and alpha values
set as 1.0, 0.0, 0.0 and 1.0 respectively
See Also:
+colorWithCalibratedRed:green:blue:alpha:
+ (
NSColor*)
scrollBarColor;
Availability: MacOS-X 10.0.0
Returns the color for scroll bars. Returns: An
NSColor for scroll bar backgrounds
+ (
NSColor*)
secondaryLabelColor;
Availability: MacOS-X 10.10.0
Description forthcoming.
+ (
NSColor*)
secondarySelectedControlColor;
Availability: MacOS-X 10.0.0
Returns the secondary selected control color.
Returns: An NSColor for secondary selection
highlighting
+ (
NSColor*)
selectedControlColor;
Availability: MacOS-X 10.0.0
Returns the selected control color. Returns: An
NSColor for selected control backgrounds
+ (
NSColor*)
selectedControlTextColor;
Availability: MacOS-X 10.0.0
Returns the text color for selected controls.
Returns: An NSColor for text in selected controls
+ (
NSColor*)
selectedKnobColor;
Availability: MacOS-X 10.0.0
Returns the color for selected knobs. Returns: An
NSColor for selected control knobs
+ (
NSColor*)
selectedMenuItemColor;
Availability: MacOS-X 10.0.0
Returns the background color for selected menu
items. Returns: An NSColor for selected menu item
backgrounds
+ (
NSColor*)
selectedMenuItemTextColor;
Availability: MacOS-X 10.0.0
Returns the text color for selected menu items.
Returns: An NSColor for text in selected menu
items
+ (
NSColor*)
selectedTextBackgroundColor;
Availability: MacOS-X 10.0.0
Returns the background color for selected text.
Returns: An NSColor for selected text backgrounds
+ (
NSColor*)
selectedTextColor;
Availability: MacOS-X 10.0.0
Returns the color for selected text. Returns: An
NSColor for selected text
+ (void)
setIgnoresAlpha: (BOOL)flag;
Availability: OpenStep
Sets whether alpha components should be ignored in
color operations. flag:
YES to ignore
alpha components,
NO to use them
TODO
See Also:
+ignoresAlpha
+ (
NSColor*)
shadowColor;
Availability: MacOS-X 10.0.0
Returns the general shadow color. Returns: An
NSColor for general shadows
+ (
NSColor*)
systemBlueColor;
Availability: MacOS-X 10.10.0
Description forthcoming.
+ (
NSColor*)
systemBrownColor;
Availability: MacOS-X 10.10.0
Description forthcoming.
+ (
NSColor*)
systemGrayColor;
Availability: MacOS-X 10.10.0
Description forthcoming.
+ (
NSColor*)
systemGreenColor;
Availability: MacOS-X 10.10.0
Description forthcoming.
+ (
NSColor*)
systemIndigoColor;
Availability: MacOS-X 10.15.0
Description forthcoming.
+ (
NSColor*)
systemOrangeColor;
Availability: MacOS-X 10.10.0
Description forthcoming.
+ (
NSColor*)
systemPinkColor;
Availability: MacOS-X 10.10.0
Description forthcoming.
+ (
NSColor*)
systemPurpleColor;
Availability: MacOS-X 10.10.0
Description forthcoming.
+ (
NSColor*)
systemRedColor;
Availability: MacOS-X 10.10.0
Description forthcoming.
+ (
NSColor*)
systemTealColor;
Availability: MacOS-X 10.15.0
Description forthcoming.
+ (
NSColor*)
systemYellowColor;
Availability: MacOS-X 10.10.0
Description forthcoming.
+ (
NSColor*)
tertiaryLabelColor;
Availability: MacOS-X 10.10.0
Description forthcoming.
+ (
NSColor*)
textBackgroundColor;
Availability: MacOS-X 10.0.0
Returns the background color for text areas.
Returns: An NSColor for text field backgrounds
+ (
NSColor*)
textColor;
Availability: MacOS-X 10.0.0
Returns the standard text color. Returns: An
NSColor for standard text
+ (
NSColor*)
toolTipColor;
Availability: MacOS-X 10.0.0
Description forthcoming.
+ (
NSColor*)
toolTipTextColor;
Availability: MacOS-X 10.0.0
Description forthcoming.
+ (
NSColor*)
whiteColor;
Availability: OpenStep
Returns a white color (1.0, 1.0, 1.0, 1.0 in RGB).
Returns: A white NSColor instance
Returns a NSColor in a
NSCalibratedWhiteColorSpace
space name. with white and alpha values set as
NSWhite and 1.0 respectively.
See Also :
+colorWithCalibratedWhite:alpha:
+ (
NSColor*)
windowBackgroundColor;
Availability: MacOS-X 10.0.0
Returns the background color for windows. Returns:
An NSColor for window backgrounds
+ (
NSColor*)
windowFrameColor;
Availability: MacOS-X 10.0.0
Returns the color for window frames. Returns: An
NSColor for window frame borders
+ (
NSColor*)
windowFrameTextColor;
Availability: MacOS-X 10.0.0
Returns the text color for window frames. Returns:
An NSColor for text in window frames (titles, etc.)
+ (
NSColor*)
yellowColor;
Availability: OpenStep
Returns a yellow color (1.0, 1.0, 0.0, 1.0 in RGB).
Returns: A yellow NSColor instance
Returns a NSColor in a NSCalibratedRGBColorSpace
space name. with red, green, blue and alpha values
set as 1.0, 0.0, 0.0 and 1.0 respectively.
See Also :
+colorWithCalibratedRed:green:blue:alpha:
- (CGFloat)
alphaComponent;
Availability: OpenStep
Returns the alpha (transparency) component of the
color. Returns: The alpha component (0.0 to 1.0)
Returns the alpha component.
- (CGFloat)
blackComponent;
Availability: OpenStep
Returns the black component of the color in CMYK
color space. Returns: The black component (0.0 to
1.0)
Returns the black component. Raises a
NSInternalInconsistencyException
if NSColor is not a CMYK color.
- (
NSColor*)
blendedColorWithFraction: (CGFloat)fraction
ofColor: (
NSColor*)aColor;
Availability: OpenStep
Returns a color that is a blend between this color
and another color. fraction: The fraction of
the other color to blend (0.0 to 1.0) aColor: The color
to blend with Returns: A new NSColor representing the
blended color
- (CGFloat)
blueComponent;
Availability: OpenStep
Returns the blue component of the color in RGB
color space. Returns: The blue component (0.0 to 1.0)
Returns the blue component. Raises a
NSInternalInconsistencyException
if NSColor is not a RGB color.
- (CGFloat)
brightnessComponent;
Availability: OpenStep
Returns the brightness component of the color in
HSB color space. Returns: The brightness component (0.0
to 1.0)
Returns the brightness component. Raises a
NSInternalInconsistencyException
if NSColor space is not a RGB color
- (
NSString*)
catalogNameComponent;
Availability: OpenStep
Returns the catalog name component of a
catalog-based color. Returns: The name of the
color catalog, or nil if not a catalog
color
- (
NSString*)
colorNameComponent;
Availability: OpenStep
Returns the color name component of a catalog-based
color. Returns: The name of the color within the
catalog, or nil if not a catalog
color
- (
NSColorSpace*)
colorSpace;
Availability: MacOS-X 10.4.0
Returns the color space of this color. Returns: The
NSColorSpace used by this color
- (
NSString*)
colorSpaceName;
Availability: OpenStep
Returns the name of the color space used by this
color. Returns: The color space name string
- (
NSColor*)
colorUsingColorSpace: (
NSColorSpace*)space;
Availability: MacOS-X 10.4.0
Returns a version of the color converted to the
specified color space. space: The
target NSColorSpace Returns: A new NSColor in the
specified color space, or
nil if conversion fails
- (
NSColor*)
colorUsingColorSpaceName: (
NSString*)colorSpace;
Availability: OpenStep
Returns a version of the color converted to the
specified color space. colorSpace: The target
color space name Returns: A new NSColor in the
specified color space, or nil if
conversion fails
- (
NSColor*)
colorUsingColorSpaceName: (
NSString*)colorSpace
device: (
NSDictionary*)deviceDescription;
Availability: OpenStep
Returns a version of the color converted to the
specified color space and device. colorSpace: The
target color space name deviceDescription:
Dictionary describing the target device
characteristics Returns: A new NSColor in
the specified color space for the device, or
nil if conversion fails
- (
NSColor*)
colorUsingType: (
NSColorType)type;
Availability: MacOS-X 10.13.0
Description forthcoming.
- (
NSColor*)
colorWithAlphaComponent: (CGFloat)alpha;
Availability: OpenStep
Returns a version of the color with a different
alpha component. alpha: The new
alpha value (0.0 to 1.0) Returns: A new
NSColor with the specified alpha
component
- (CGFloat)
cyanComponent;
Availability: OpenStep
Returns the cyan component of the color in CMYK
color space. Returns: The cyan component (0.0 to 1.0)
Returns the cyan component. Raises a
NSInternalInconsistencyException
if NSColor is not a CYMK color
- (void)
drawSwatchInRect: (
NSRect)rect;
Availability: OpenStep
Draws a color swatch in the specified rectangle.
rect: The rectangle to draw the color swatch in
- (void)
getComponents: (CGFloat*)components;
Availability: MacOS-X 10.4.0
Gets all component values of the color. components:
Array to store the component values
- (void)
getCyan: (CGFloat*)cyan
magenta: (CGFloat*)magenta
yellow: (CGFloat*)yellow
black: (CGFloat*)black
alpha: (CGFloat*)alpha;
Availability: OpenStep
Gets the CMYK components of the color. cyan: Pointer
to store the
cyan component (0.0 to 1.0)
magenta: Pointer to store the
magenta
component (0.0 to 1.0) yellow: Pointer to store
the
yellow component (0.0 to 1.0) black:
Pointer to store the
black component
(0.0 to 1.0) alpha: Pointer to store the
alpha component (0.0 to 1.0)
Gets the cyan, magenta,
yellow,black and alpha values
from the NSColor. Raises a
NSInternalInconsistencyException
if the NSColor is not a CYMK color
- (void)
getHue: (CGFloat*)hue
saturation: (CGFloat*)saturation
brightness: (CGFloat*)brightness
alpha: (CGFloat*)alpha;
Availability: OpenStep
Gets the HSB components of the color. hue: Pointer to
store the
hue component (0.0 to 1.0)
saturation: Pointer to store the
saturation component (0.0 to 1.0)
brightness: Pointer to store the
brightness component (0.0 to 1.0) alpha:
Pointer to store the
alpha component
(0.0 to 1.0)
Gets the hue, saturation,
brightness and alpha values
from the NSColor. Raises a
NSInternalInconsistencyException
if the NSColor is not a RGB color
- (void)
getRed: (CGFloat*)red
green: (CGFloat*)green
blue: (CGFloat*)blue
alpha: (CGFloat*)alpha;
Availability: OpenStep
Gets the RGB components of the color. red: Pointer to
store the
red component (0.0 to 1.0)
green: Pointer to store the
green
component (0.0 to 1.0) blue: Pointer to store the
blue component (0.0 to 1.0) alpha: Pointer
to store the
alpha component (0.0 to 1.0)
Gets the red, green,
blue and alpha values from
the NSColor. Raises a
NSInternalInconsistencyException
if the NSColor is not a RGB color
- (void)
getWhite: (CGFloat*)white
alpha: (CGFloat*)alpha;
Availability: OpenStep
Gets the grayscale components of the color. white:
Pointer to store the grayscale value (0.0 to 1.0)
alpha: Pointer to store the
alpha
component (0.0 to 1.0)
Gets the white alpha values
from the NSColor. Raises a
NSInternalInconsistencyException
if the NSColor is not a greyscale color
- (CGFloat)
greenComponent;
Availability: OpenStep
Returns the green component of the color in RGB
color space. Returns: The green component (0.0 to
1.0)
Returns the green component. Raises a
NSInternalInconsistencyException
if NSColor is not a RGB color
- (
NSColor*)
highlightWithLevel: (CGFloat)level;
Availability: MacOS-X 10.0.0
Returns a highlighted version of the color. level:
The highlight level (0.0 for no change, 1.0
for maximum highlight) Returns: A new NSColor
representing the highlighted color
- (CGFloat)
hueComponent;
Availability: OpenStep
Returns the hue component of the color in HSB color
space. Returns: The hue component (0.0 to 1.0)
Returns the hue component. Raises a
NSInternalInconsistencyException
if NSColor is not a RGB color
- (
NSString*)
localizedCatalogNameComponent;
Availability: OpenStep
Returns the localized catalog name component of a
catalog-based color. Returns: The localized
name of the color catalog, or nil if not
a catalog color
- (
NSString*)
localizedColorNameComponent;
Availability: OpenStep
Returns the localized color name component of a
catalog-based color. Returns: The localized
name of the color within the catalog, or
nil if not a catalog color
- (CGFloat)
magentaComponent;
Availability: OpenStep
Returns the magenta component of the color in CMYK
color space. Returns: The magenta component (0.0 to
1.0)
Returns the magenta component. Raises a
NSInternalInconsistencyException
if NSColor is not a CMYK color
- (
NSInteger)
numberOfComponents;
Availability: MacOS-X 10.4.0
Returns the number of color components in this
color. Returns: The number of components (excluding
alpha)
- (
NSImage*)
patternImage;
Availability: MacOS-X 10.0.0
Description forthcoming.
- (CGFloat)
redComponent;
Availability: OpenStep
Returns the red component of the color in RGB color
space. Returns: The red component (0.0 to 1.0)
Returns the red component. Raises a
NSInternalInconsistencyException
if NSColor is not a RGB color
- (CGFloat)
saturationComponent;
Availability: OpenStep
Returns the saturation component of the color in
HSB color space. Returns: The saturation component (0.0
to 1.0)
Returns the saturation component. Raises a
NSInternalInconsistencyException
if NSColor is not a RGB color
- (void)
set;
Availability: OpenStep
Sets the color as both the fill and stroke color in
the current graphics context.
- (void)
setFill;
Availability: MacOS-X 10.3.0
Sets the color as the fill color in the current
graphics context.
- (void)
setStroke;
Availability: MacOS-X 10.3.0
Sets the color as the stroke color in the current
graphics context.
- (
NSColor*)
shadowWithLevel: (CGFloat)level;
Availability: MacOS-X 10.0.0
Returns a shadowed version of the color. level: The
shadow level (0.0 for no change, 1.0 for
maximum shadow) Returns: A new NSColor representing
the shadowed color
- (
NSColorType)
type;
Availability: MacOS-X 10.13.0
Description forthcoming.
- (CGFloat)
whiteComponent;
Availability: OpenStep
Returns the white component of the color in
grayscale color space. Returns: The white
component (0.0 to 1.0)
Returns the white component. Raises a
NSInternalInconsistencyException
if NSColor is not a grayscale color
- (void)
writeToPasteboard: (
NSPasteboard*)pasteBoard;
Availability: OpenStep
Writes color data to the specified pasteboard.
pasteBoard: The pasteboard to write the color
data to
Writes the NSColor into the NSPasteboard specified
by pasteBoard
See Also:
+colorFromPasteboard:
- (CGFloat)
yellowComponent;
Availability: OpenStep
Returns the yellow component of the color in CMYK
color space. Returns: The yellow component (0.0 to
1.0)
Returns the yellow component. Raises a
NSInternalInconsistencyException
if NSColor is not a RGB color
- Declared in:
- AppKit/NSColor.h
Availability: Not in OpenStep/MacOS-X
Description forthcoming.
- (
NSColor*)
decodeNXColor;
Availability: Not in OpenStep/MacOS-X
Description forthcoming.
- Declared in:
- AppKit/NSColor.h
Availability: OpenStep
Description forthcoming.
- (
CGColorRef)
CGColor;
Availability: MacOS-X 10.3.0
Description forthcoming.
Up