| Inherits from | |
| Conforms to | |
| Framework | /System/Library/Frameworks/AppKit.framework |
| Availability | Available in Mac OS X v10.0 and later. |
| Companion guide | |
| Declared in | NSColorPicker.h |
| Related sample code |
The NSColorPicker class is an abstract superclass that implements the NSColorPickingDefault protocol. The NSColorPickingDefault and NSColorPickingCustom protocols define a way to add color pickers (custom user interfaces for color selection) to the NSColorPanel.
Does nothing. Override to attach a color list to a color picker.
- (void)attachColorList:(NSColorList *)colorList
The color list to attach to the color picker.
NSColorPicker.hReturns the tool tip to be shown when the mouse cursor is over the receiver’s button image.
- (NSString *)buttonToolTip
A string representing the tool tip.
Override this method to provide a custom tool tip. The default implementation of this method returns the name of the receiver’s class. If you want the color picker to have no tool tip, return an empty string.
NSColorPicker.hReturns the NSColorPanel that owns the receiver.
- (NSColorPanel *)colorPanel
The owning color panel.
NSColorPicker.hDoes nothing. Override to detach a color list from a color picker.
- (void)detachColorList:(NSColorList *)colorList
The color list to detach.
NSColorPicker.hInitializes the color picker with the specified color panel and color picker mode mask.
- (id)initWithPickerMask:(NSUInteger)mask colorPanel:(NSColorPanel *)owningColorPanel
The color picker mask.
The NSColorPanel that owns the color picker. This value is cached so it can be returned later by the colorPanel method.
An initialized color picker object.
Override this method to respond to the values in mask or do other custom initialization. If you override this method in a subclass, you should forward the message to super as part of the implementation.
NSColorPicker.hSets the image used for the specified button cell.
- (void)insertNewButtonImage:(NSImage *)newButtonImage in:(NSButtonCell *)buttonCell
The image used for the specified button cell.
The button cell for which to set the image.
Called by the color panel to insert a new image into the specified cell by invoking NSButtonCell’s setImage: method. Override this method to customize newButtonImage before insertion in buttonCell.
NSColorPicker.hReturns the minimum content size for the receiver.
- (NSSize)minContentSize
The minimum size of the receiver, an NSColorPicker object. The NSColorPanel object does not allow the color picker to be made smaller than this size.
Override this method to return a minimum size for the color picker’s content area. The default implementation of this method obtains the minimum content size from the view-autoresizing behavior specified for the receiver and returns that. You should not have to override this method if you properly set up the color picker’s auto-sizing attributes in Interface Builder.
NSColorPicker.hReturns the button image for the receiver.
- (NSImage *)provideNewButtonImage
The image placed on the mode button the user uses to select this color picker. This is the same image the color panel uses as an argument when sending the insertNewButtonImage:in: message.) The default implementation looks in the color picker’s bundle for a TIFF file named after the color picker’s class, with the extension “.tiff”.
NSColorPicker.hDoes nothing. Override to set the color picker’s mode.
- (void)setMode:(NSColorPanelMode)mode
A constant specifying the color picking mode. These constants are defined in AppKit/NSColorPanel.h.
In grayscale-alpha, red-green-blue, cyan-magenta-yellow-black, and hue-saturation-brightness modes, the user adjusts colors by manipulating sliders. In the custom palette mode, the user can load an NSImage file (TIFF or EPS) into the NSColorPanel, then select colors from the image. In custom color list mode, the user can create and load lists of named colors. The two custom modes provide NSPopUpLists for loading and saving files. Finally, color wheel mode provides a simplified control for selecting colors.
NSColorPicker.hDoes nothing. Override to respond to a size change.
- (void)viewSizeChanged:(id)sender
NSColorPicker.hLast updated: 2007-02-28