Up
Authors
- Scott Christley (
scottc@net-community.com)
-
Date: Generated at 2025-12-03
System generic color panel
Copyright: (C) 1996 Free Software Foundation, Inc.
- Declared in:
- AppKit/NSColorPanel.h
Availability: OpenStep
NSColorPanel provides a comprehensive color
selection interface that allows users to choose
colors using various color picking methods and modes.
The panel is typically used as a shared system-wide color
picker that can be integrated into applications
requiring color selection functionality. Key
features include: * Multiple color picker modes
(RGB, HSB, CMYK, grayscale, wheel, crayon, etc.) *
Customizable picker mask to enable/disable
specific color modes * Alpha transparency support
with optional alpha slider * Target-action pattern for
color change notifications * Continuous or discrete
update modes * Color list integration for predefined
color collections * Accessory view support for custom
interface extensions * Drag and drop color support
for easy color sharing * Automatic color space conversion
between picker modes The color panel operates as a
singleton shared instance and integrates seamlessly
with the application's event system. It supports both
programmatic color setting and interactive user
selection, with flexible notification mechanisms
to keep the application synchronized with color changes.
Color picker modes can be selectively enabled or
disabled using picker masks, allowing applications
to restrict the available color selection methods to match
their specific requirements or user interface
constraints.
TODO Description
NSColorPanel declares 14 Instance Variables
+ (BOOL)
dragColor: (
NSColor*)aColor
withEvent: (
NSEvent*)anEvent
fromView: (
NSView*)sourceView;
Availability: OpenStep
Initiates a drag operation with the specified
color. aColor: The color to drag anEvent: The mouse
event that initiated the drag sourceView: The view
from which the drag originated Returns:
YES if the drag was successful,
NO otherwise
Drags aColor from sourceView
at the location give by the event anEvent (
[NSView -convertPoint:fromView:]
). The type declared into the pasteboard is NSColorPboardType
See Also:
[NSView -convertPoint:fromView:]
[NSView-dragImage:at:offset:event:pasteboard:source:slideBack:
+ (void)
setPickerMask: (int)mask;
Availability: OpenStep
Sets which color picker modes are available in the
color panel. mask: Bitmask of NSColorPanel*ModeMask
constants specifying available modes
Determines color selection modes availible to
the the NSApplications colorPanel.
+ (void)
setPickerMode: (int)mode;
Availability: OpenStep
Sets the current color picker mode for new
color panel instances. mode: The color picker
mode constant (NSGrayModeColorPanel, etc.)
Specifies color panel's initial picker.
+ (
NSColorPanel*)
sharedColorPanel;
Availability: OpenStep
Returns the shared color panel instance, creating
it if necessary. Returns: The singleton NSColorPanel
instance for the application
Creates (if needed) and returns the shared
NSColorPanel.
+ (BOOL)
sharedColorPanelExists;
Availability: OpenStep
Returns whether the shared color panel has been
created. Returns:
YES if the shared
color panel exists,
NO otherwise
Returns whether the NSColorPanel has been already
created.
- (
NSView*)
accessoryView;
Availability: OpenStep
Returns the accessory view displayed in the color
panel. Returns: The current accessory view, or
nil if none is set
Returns the NSColorPanel's accessory view if it
exists, nil otherwise.
See Also:
-setAccessoryView:
- (CGFloat)
alpha;
Availability: OpenStep
Returns the current alpha transparency value.
Returns: The alpha component (0.0 to 1.0) of the
current color
Returns the alpha value of the NSColorPanel.
Returns 1.0 if the NSColorPanel does not show
alpha
See Also:
-showsAlpha
-setShowsAlpha:
- (void)
attachColorList: (
NSColorList*)aColorList;
Availability: OpenStep
Attaches a color list to the color panel for the
color list picker mode. aColorList: The NSColorList
to make available in the color panel
Adds a color
list to all of the color pickers of the receiver.
- (
NSColor*)
color;
Availability: OpenStep
Returns the currently selected color. Returns: The
NSColor currently selected in the color panel
Returns the current NSColor displayed by the
NSColorPanel.
See Also :
-setColor:
- (void)
detachColorList: (
NSColorList*)aColorList;
Availability: OpenStep
Detaches a color list from the color panel.
aColorList: The NSColorList to remove from the
color panel
Removes the referenced color list
to all of the color pickers of the receiver.
- (BOOL)
isContinuous;
Availability: OpenStep
Returns whether the color panel operates in
continuous mode. Returns:
YES if
the panel sends continuous updates,
NO for
discrete updates
Returns whether the NSColorPanel continuously
sends its action message.
See Also: -setContinuous:-setAction:
-setTarget:
- (int)
mode;
Availability: OpenStep
Returns the current color picker mode. Returns: The
current mode constant (NSGrayModeColorPanel, etc.)
Returns the current mode of the NSColorPanel.
See Also:
-setMode:
- (void)
setAccessoryView: (
NSView*)aView;
Availability: OpenStep
Sets an accessory view to display in the color panel.
aView: The view to display as an accessory, or
nil to remove
Sets the accessoryView to a view. The old view (if
exists) will be removed (and released). You need
to retain it if you want to use it later
See Also:
-accessoryView
- (void)
setAction: (SEL)aSelector;
Availability: OpenStep
Sets the action message sent when the color changes.
aSelector: The selector to invoke on the target
when color changes
Sets the NSColorPanl action method to
aSelector The action message is usally
send in
-setColor:
, when the picker is updated, when a new picker is
shown, when the alpha is changed or when one of
the color wells at the bottom is selected.
- (void)
setColor: (
NSColor*)aColor;
Availability: OpenStep
Sets the current color in the color panel. aColor: The
color to display and select in the panel
Sets the NSColor displayed to aColor.
This method posts a
NSColorPanelColorDidChangeNotification
notification if needed.
See Also: -color
[NSColorWell -setColor:]
- (void)
setContinuous: (BOOL)flag;
Availability: OpenStep
Sets whether the color panel operates in continuous
mode. flag:
YES for continuous updates
during interaction,
NO for discrete
updates
Sets whether the NSColorPanel sends continuously
action messages
See Also:
-isContinuous
- (void)
setMode: (int)mode;
Availability: OpenStep
Sets the current color picker
mode. mode:
The color picker
mode constant to activate
Set the NSColorPanel mode to
mode.
See Also: -mode
- (void)
setShowsAlpha: (BOOL)flag;
Availability: OpenStep
Sets whether the alpha transparency slider is visible.
flag:
YES to show the alpha slider,
NO to hide it
Sets whether the NSColorPanel shows alpha values and
the alpha slider.
See Also:
-showsAlpha
- (void)
setTarget: (id)anObject;
Availability: OpenStep
Sets the target object for color change actions.
anObject: The object to receive action messages
when color changes
Sets the target object to anObject
- (BOOL)
showsAlpha;
Availability: OpenStep
Returns whether the alpha transparency slider is
visible. Returns:
YES if the alpha
slider is shown,
NO if hidden
Returns whether the NSColorPanel shows alpha
values and the alpha slider
See Also:
-setShowsAlpha:
Instance Variables for NSColorPanel Class
@protected NSView*
_accessoryView;
Availability: OpenStep
Warning the underscore at the start of the
name of this instance variable indicates that, even
though it is not technically private, it is
intended for internal use within the package, and
you should not use the variable in other code.
@protected SEL
_action;
Availability: OpenStep
Warning the underscore at the start of the
name of this instance variable indicates that, even
though it is not technically private, it is
intended for internal use within the package, and
you should not use the variable in other code.
@protected NSSlider*
_alphaSlider;
Availability: OpenStep
Warning the underscore at the start of the
name of this instance variable indicates that, even
though it is not technically private, it is
intended for internal use within the package, and
you should not use the variable in other code.
@protected NSColorWell*
_colorWell;
Availability: OpenStep
Warning the underscore at the start of the
name of this instance variable indicates that, even
though it is not technically private, it is
intended for internal use within the package, and
you should not use the variable in other code.
@protected id
_currentPicker;
Availability: OpenStep
Warning the underscore at the start of the
name of this instance variable indicates that, even
though it is not technically private, it is
intended for internal use within the package, and
you should not use the variable in other code.
@protected BOOL _isContinuous;
Availability: OpenStep
Warning the underscore at the start of the
name of this instance variable indicates that, even
though it is not technically private, it is
intended for internal use within the package, and
you should not use the variable in other code.
@protected NSButton* _magnifyButton;
Availability: OpenStep
Warning the underscore at the start of the
name of this instance variable indicates that, even
though it is not technically private, it is
intended for internal use within the package, and
you should not use the variable in other code.
@protected NSBox* _pickerBox;
Availability: OpenStep
Warning the underscore at the start of the
name of this instance variable indicates that, even
though it is not technically private, it is
intended for internal use within the package, and
you should not use the variable in other code.
@protected NSMatrix* _pickerMatrix;
Availability: OpenStep
Warning the underscore at the start of the
name of this instance variable indicates that, even
though it is not technically private, it is
intended for internal use within the package, and
you should not use the variable in other code.
@protected NSMutableArray* _pickers;
Availability: OpenStep
Warning the underscore at the start of the
name of this instance variable indicates that, even
though it is not technically private, it is
intended for internal use within the package, and
you should not use the variable in other code.
@protected BOOL _showsAlpha;
Availability: OpenStep
Warning the underscore at the start of the
name of this instance variable indicates that, even
though it is not technically private, it is
intended for internal use within the package, and
you should not use the variable in other code.
@protected NSSplitView* _splitView;
Availability: OpenStep
Warning the underscore at the start of the
name of this instance variable indicates that, even
though it is not technically private, it is
intended for internal use within the package, and
you should not use the variable in other code.
@protected id _target;
Availability: OpenStep
Warning the underscore at the start of the
name of this instance variable indicates that, even
though it is not technically private, it is
intended for internal use within the package, and
you should not use the variable in other code.
@protected NSView* _topView;
Availability: OpenStep
Warning the underscore at the start of the
name of this instance variable indicates that, even
though it is not technically private, it is
intended for internal use within the package, and
you should not use the variable in other code.
- Declared in:
- AppKit/NSColorPanel.h
Availability: OpenStep
Description forthcoming.
- (void)
orderFrontColorPanel: (id)sender;
Availability: OpenStep
Brings the shared color panel to the front and makes
it key. sender: The object that sent the message
(typically a menu item or button)
Up