Platforms to show: All Mac Windows Linux Cross-Platform

Back to NSColorPanelMBS class.

NSColorPanelMBS.attachColorList(list as NSColorListMBS)

Type Topic Plugin Version macOS Windows Linux iOS Targets
method Cocoa Drawing MBS MacCocoa Plugin 7.2 ✅ Yes ❌ No ❌ No ❌ No Desktop only
Attaches the given color list to the panel.

An application should use this method to add an NSColorList saved with a document in its file package or in a directory other than NSColorList's standard search directories.

NSColorPanelMBS.Constructor

Type Topic Plugin Version macOS Windows Linux iOS Targets
method Cocoa Drawing MBS MacCocoa Plugin 8.4 ✅ Yes ❌ No ❌ No ❌ No Desktop only
The constructor to create a new color panel.

NSColorPanelMBS.detachColorList(list as NSColorListMBS)

Type Topic Plugin Version macOS Windows Linux iOS Targets
method Cocoa Drawing MBS MacCocoa Plugin 7.2 ✅ Yes ❌ No ❌ No ❌ No Desktop only
Detaches the color list from the panel.

NSColorPanelMBS.GetColor(byref red as single, byref green as single, byref blue as single, byref alpha as single) as boolean

Type Topic Plugin Version macOS Windows Linux iOS Targets
method Cocoa Drawing MBS MacCocoa Plugin 7.2 ✅ Yes ❌ No ❌ No ❌ No Desktop only
The current color in the RGB color model.

Values from 0.0 to 1.0.
Returns true if the values are valid.

See also:

NSColorPanelMBS.SetColor(red as single, green as single, blue as single, alpha as single)

Type Topic Plugin Version macOS Windows Linux iOS Targets
method Cocoa Drawing MBS MacCocoa Plugin 7.2 ✅ Yes ❌ No ❌ No ❌ No Desktop only
Sets the color.

Values from 0.0 to 1.0.

See also:

NSColorPanelMBS.setColor(value as NSColorMBS)

Type Topic Plugin Version macOS Windows Linux iOS Targets
method Cocoa Drawing MBS MacCocoa Plugin 7.2 ✅ Yes ❌ No ❌ No ❌ No Desktop only
Sets the color.

See also:

NSColorPanelMBS.setContinuous(value as boolean)

Type Topic Plugin Version macOS Windows Linux iOS Targets
method Cocoa Drawing MBS MacCocoa Plugin 7.2 ✅ Yes ❌ No ❌ No ❌ No Desktop only
Whether you want to receive Changed events while the user chooses the color.

Set value to true to have the receiver calls the Changed event continuously as the color of the NSColorPanel is set by the user; otherwise false.

Some examples using this method:

NSColorPanelMBS.setMode(value as Integer)

Type Topic Plugin Version macOS Windows Linux iOS Targets
method Cocoa Drawing MBS MacCocoa Plugin 7.2 ✅ Yes ❌ No ❌ No ❌ No Desktop only
Sets the mode of the panel the mode is one of the modes allowed by the color mask.

Constants:

const NSGrayModeColorPanel= 0
const NSRGBModeColorPanel= 1
const NSCMYKModeColorPanel= 2
const NSHSBModeColorPanel= 3
const NSCustomPaletteModeColorPanel= 4
const NSColorListModeColorPanel= 5
const NSWheelModeColorPanel= 6
const NSCrayonModeColorPanel= 7

NSColorPanelMBS.SetPickerMode(value as Integer)

Type Topic Plugin Version macOS Windows Linux iOS Targets
method Cocoa Drawing MBS MacCocoa Plugin 7.2 ✅ Yes ❌ No ❌ No ❌ No Desktop only
Specifies the color panel's initial picker.

Constants:
NSColorPanelGrayModeMask= &h00000001
NSColorPanelRGBModeMask= &h00000002
NSColorPanelCMYKModeMask= &h00000004
NSColorPanelHSBModeMask= &h00000008
NSColorPanelCustomPaletteModeMask= &h00000010
NSColorPanelColorListModeMask= &h00000020
NSColorPanelWheelModeMask= &h00000040
NSColorPanelCrayonModeMask= &h00000080
NSColorPanelAllModesMask= &h0000ffff

Some examples using this method:

NSColorPanelMBS.setShowsAlpha(value as boolean)

Type Topic Plugin Version macOS Windows Linux iOS Targets
method Cocoa Drawing MBS MacCocoa Plugin 7.2 ✅ Yes ❌ No ❌ No ❌ No Desktop only
Tells the panel whether or not to show alpha values and an opacity slider.

Note that calling the NSColor method setIgnoresAlpha with a value of true overrides any value set with this method.

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


The biggest plugin in space...