NSColorPanelMBS class

Online Documentation   -   Statistics   -   FAQ   -   Plugin Parts (All, Dependencies)   -   Class hierarchy

New in Version 22.2 22.3 22.4 22.5 23.0 23.1 23.2 23.3 23.4 23.5 24.0 24.1

The list of the   topics,   classes,   interfaces,   controls,   modules,   global methods by category,   global methods by name,   screenshots,   licenses   and   examples.

Platforms to show: All Mac Windows Linux Cross-Platform

NSColorPanelMBS class

Super class: NSPanelMBS

Type Topic Plugin Version macOS Windows Linux iOS Targets
class Cocoa Drawing MBS MacCocoa Plugin 7.2 ✅ Yes ❌ No ❌ No ❌ No Desktop only
A class to control a Color Panel (floating window).

If you use SelectColor in your application, this color panel will be converted in a dialog which makes this class useless.

You should only have one instance of this class in your application.

If you compile for Cocoa, a TextField/TextArea automatically registers for color panel. So in order to avoid them updating text color with color panel selection, clear the focus by calling window.clearfocus method.

This class does only work on desktop computers, not in a webbrowser.

See WinColorPickerMBS class for Windows.
Subclass of the NSPanelMBS class.

Modes

Constant Value Description
NSCMYKModeColorPanel 2 Cyan-yellow-magenta-black
NSColorListModeColorPanel 5 Custom color list
NSCrayonModeColorPanel 7 Crayons.
NSCustomPaletteModeColorPanel 4 Custom palette
NSGrayModeColorPanel 0 Grayscale-alpha
NSHSBModeColorPanel 3 Hue-saturation-brightness
NSNoModeColorPanel -1 Indicates no color panel mode.
Available in OS X version 10.5 and later.
NSRGBModeColorPanel 1 Red-green-blue
NSWheelModeColorPanel 6 Color wheel

Masks

Constant Value Description
NSColorPanelAllModesMask &h0000ffff All of the above.
NSColorPanelCMYKModeMask &h00000004 Cyan-yellow-magenta-black.
NSColorPanelColorListModeMask &h00000020 Custom color list.
NSColorPanelCrayonModeMask &h00000080 Crayons.
NSColorPanelCustomPaletteModeMask &h00000010 Custom palette.
NSColorPanelGrayModeMask &h00000001 Grayscale-alpha.
NSColorPanelHSBModeMask &h00000008 Hue-saturation-brightness.
NSColorPanelRGBModeMask &h00000002 Red-green-blue.
NSColorPanelWheelModeMask &h00000040 Color wheel.

Super class NSPanelMBS

Constants

Constant Value Description
NSAlertAlternateReturn 0 One of the possible return values for the alert panels. The user pressed the alternate button.
NSAlertDefaultReturn 1 One of the possible return values for the alert panels. The user pressed the default button.
NSAlertErrorReturn -2 One of the possible return values for the alert panels. The alert cannot identify the reason it was closed; it may have been closed by an external source or by a button other than those listed above.
NSAlertOtherReturn -1 One of the possible return values for the alert panels. The user pressed a second alternate button.
NSCancelButton 0 One of the constants for the modal panel return values. The Cancel button.
NSDocModalWindowMask 64 One of the constants you can use to specify the style when creating a window. The panel is created as a modal sheet.
NSHUDWindowMask 8192 One of the constants you can use to specify the style when creating a window.
NSNonactivatingPanelMask 128 One of the constants you can use to specify the style when creating a window. The panel can receive keyboard input without activating the owning application.
NSOKButton 1 One of the constants for the modal panel return values. The OK button.
NSUtilityWindowMask 16 One of the constants you can use to specify the style when creating a window. The panel is created as a floating window.

Super class NSWindowMBS

Super class NSResponderMBS

This class has no sub classes.

Some examples using this class:

Blog Entries


The items on this page are in the following plugins: MBS MacBase Plugin, MBS MacCocoa Plugin.


NSColorMBS   -   NSColorPickerTouchBarItemMBS


💬 Ask a question or report a problem