Platforms to show: All Mac Windows Linux Cross-Platform

Back to NSColorMBS class.

NSColorMBS.alphaComponent as Double
Type Topic Plugin Version macOS Windows Linux iOS Targets
property Cocoa Drawing MBS MacBase Plugin 7.2 ✅ Yes ❌ No ❌ No ❌ No Desktop, Console & Web
Function: The alpha value of the color.
Example:
dim c as NSColorMBS = NSColorMBS.blueColor
MsgBox str(c.alphaComponent)
Notes:
Value is from 0.0 to 1.0.
(Read only property)
NSColorMBS.blackComponent as Double
Type Topic Plugin Version macOS Windows Linux iOS Targets
property Cocoa Drawing MBS MacBase Plugin 7.2 ✅ Yes ❌ No ❌ No ❌ No Desktop, Console & Web
Function: The color value from a CMYK color.
Example:
dim c as NSColorMBS = NSColorMBS.colorWithDeviceCMYK(0.1, 0.2, 0.3, 0.4)
MsgBox str(c.blackComponent)
Notes:
Value is from 0.0 to 1.0.
(Read only property)
NSColorMBS.blueComponent as Double
Type Topic Plugin Version macOS Windows Linux iOS Targets
property Cocoa Drawing MBS MacBase Plugin 7.2 ✅ Yes ❌ No ❌ No ❌ No Desktop, Console & Web
Function: The color value from a RGB color.
Example:
dim c as NSColorMBS = NSColorMBS.blueColor
MsgBox str(c.blueComponent)
Notes:
Value is from 0.0 to 1.0.
(Read only property)
NSColorMBS.brightnessComponent as Double
Type Topic Plugin Version macOS Windows Linux iOS Targets
property Cocoa Drawing MBS MacBase Plugin 7.2 ✅ Yes ❌ No ❌ No ❌ No Desktop, Console & Web
Function: The color value from a HSV color.
Example:
dim c as NSColorMBS = NSColorMBS.colorWithDeviceHSV(0.1, 0.2, 0.3)
MsgBox str(c.brightnessComponent)
Notes:
Value is from 0.0 to 1.0.
(Read only property)
NSColorMBS.catalogNameComponent as string
Type Topic Plugin Version macOS Windows Linux iOS Targets
property Cocoa Drawing MBS MacBase Plugin 9.8 ✅ Yes ❌ No ❌ No ❌ No Desktop, Console & Web
Function: Returns the name of the catalog containing the receiver's name.
Notes:
This method raises an exception if the receiver's color space isn't NSNamedColorSpace.
(Read only property)
NSColorMBS.colorNameComponent as string
Type Topic Plugin Version macOS Windows Linux iOS Targets
property Cocoa Drawing MBS MacBase Plugin 9.8 ✅ Yes ❌ No ❌ No ❌ No Desktop, Console & Web
Function: Returns the receiver's name.
Notes:
This method raises an exception if the receiver's color space isn't NSNamedColorSpace.
(Read only property)
NSColorMBS.colorSpaceName as string
Type Topic Plugin Version macOS Windows Linux iOS Targets
property Cocoa Drawing MBS MacBase Plugin 7.2 ✅ Yes ❌ No ❌ No ✅ Yes All
Function: Get the color space of the color.
Example:
dim c as NSColorMBS = NSColorMBS.colorWithDeviceHSV(0.1, 0.2, 0.3)

MsgBox c.colorSpaceName
Notes: (Read only property)
NSColorMBS.colorValue as color
Type Topic Plugin Version macOS Windows Linux iOS Targets
property Cocoa Drawing MBS MacBase Plugin 9.4 ✅ Yes ❌ No ❌ No ✅ Yes All
Function: Returns the color value of this color (ignoring color space).
Notes:
The alphaComponent is ignored.
Returns RGB(RedComponent*255, GreenComponent*255, BlueComponent*255).

Plugin converts color to calibrated RGB if needed.
The color is converted to generic RGB Colorspace if needed as that is the one Xojo uses for pictures.
(Read only property)
NSColorMBS.cyanComponent as Double
Type Topic Plugin Version macOS Windows Linux iOS Targets
property Cocoa Drawing MBS MacBase Plugin 7.2 ✅ Yes ❌ No ❌ No ❌ No Desktop, Console & Web
Function: The color value from a CMYK color.
Example:
dim c as NSColorMBS = NSColorMBS.colorWithDeviceCMYK(0.1, 0.2, 0.3, 0.4)
MsgBox str(c.cyanComponent)
Notes:
Value is from 0.0 to 1.0.
(Read only property)
NSColorMBS.description as string
Type Topic Plugin Version macOS Windows Linux iOS Targets
property Cocoa Drawing MBS MacBase Plugin 9.8 ✅ Yes ❌ No ❌ No ✅ Yes All
Function: The description of the color object.
Example:
dim n as NSColorMBS = NSColorMBS.blueColor

MsgBox n.description // shows "NSCalibratedRGBColorSpace 0 0 1 1"
Notes: (Read only property)
NSColorMBS.greenComponent as Double
Type Topic Plugin Version macOS Windows Linux iOS Targets
property Cocoa Drawing MBS MacBase Plugin 7.2 ✅ Yes ❌ No ❌ No ❌ No Desktop, Console & Web
Function: The color value from a RGB color.
Example:
dim c as NSColorMBS = NSColorMBS.blueColor
MsgBox str(c.greenComponent)
Notes:
Value is from 0.0 to 1.0.
(Read only property)
NSColorMBS.Handle as Integer
Type Topic Plugin Version macOS Windows Linux iOS Targets
property Cocoa Drawing MBS MacBase Plugin 16.1 ✅ Yes ❌ No ❌ No ✅ Yes All
Function: The internal object reference.
Notes:
Useful for declares. Value is a NSColor pointer.
(Read and Write property)
NSColorMBS.hueComponent as Double
Type Topic Plugin Version macOS Windows Linux iOS Targets
property Cocoa Drawing MBS MacBase Plugin 7.2 ✅ Yes ❌ No ❌ No ❌ No Desktop, Console & Web
Function: The color value from a HSV color.
Example:
dim c as NSColorMBS = NSColorMBS.colorWithDeviceHSV(0.1, 0.2, 0.3)
MsgBox str(c.hueComponent)
Notes:
Value is from 0.0 to 1.0.
(Read only property)
NSColorMBS.localizedCatalogNameComponent as string
Type Topic Plugin Version macOS Windows Linux iOS Targets
property Cocoa Drawing MBS MacBase Plugin 9.8 ✅ Yes ❌ No ❌ No ❌ No Desktop, Console & Web
Function: Returns the name of the catalog containing the receiver's name as a localized string.
Notes:
This string may be displayed in user interface items like color pickers.
(Read only property)
NSColorMBS.localizedColorNameComponent as string
Type Topic Plugin Version macOS Windows Linux iOS Targets
property Cocoa Drawing MBS MacBase Plugin 9.8 ✅ Yes ❌ No ❌ No ❌ No Desktop, Console & Web
Function: Returns the name of the receiver as a localized string.
Notes:
The name of color object as a localized string. This string may be displayed in user interface items like color pickers.
(Read only property)
NSColorMBS.magentaComponent as Double
Type Topic Plugin Version macOS Windows Linux iOS Targets
property Cocoa Drawing MBS MacBase Plugin 7.2 ✅ Yes ❌ No ❌ No ❌ No Desktop, Console & Web
Function: The color value from a CMYK color.
Example:
dim c as NSColorMBS = NSColorMBS.colorWithDeviceCMYK(0.1, 0.2, 0.3, 0.4)
MsgBox str(c.magentaComponent)
Notes:
Value is from 0.0 to 1.0.
(Read only property)
NSColorMBS.numberOfComponents as Integer
Type Topic Plugin Version macOS Windows Linux iOS Targets
property Cocoa Drawing MBS MacBase Plugin 9.8 ✅ Yes ❌ No ❌ No ✅ Yes All
Function: Returns the number of components in the receiver.
Example:
dim n as NSColorMBS = NSColorMBS.blueColor

MsgBox str(n.numberOfComponents) // shows 4
Notes:
The number of components in the color object. The floating-point components counted include alpha. This method raises an exception if the receiver doesn't have floating-point components.

Available in Mac OS X v10.4 and later.
(Read only property)
NSColorMBS.redComponent as Double
Type Topic Plugin Version macOS Windows Linux iOS Targets
property Cocoa Drawing MBS MacBase Plugin 7.2 ✅ Yes ❌ No ❌ No ❌ No Desktop, Console & Web
Function: The color value from a RGB color.
Example:
dim c as NSColorMBS = NSColorMBS.blueColor
MsgBox str(c.redComponent)
Notes:
Value is from 0.0 to 1.0.
(Read only property)
NSColorMBS.saturationComponent as Double
Type Topic Plugin Version macOS Windows Linux iOS Targets
property Cocoa Drawing MBS MacBase Plugin 7.2 ✅ Yes ❌ No ❌ No ❌ No Desktop, Console & Web
Function: The color value from a HSV color.
Example:
dim c as NSColorMBS = NSColorMBS.colorWithDeviceHSV(0.1, 0.2, 0.3)
MsgBox str(c.saturationComponent)
Notes:
Value is from 0.0 to 1.0.
(Read only property)
NSColorMBS.Type as Integer
Type Topic Plugin Version macOS Windows Linux iOS Targets
property Cocoa Drawing MBS MacBase Plugin 18.4 ✅ Yes ❌ No ❌ No ❌ No Desktop, Console & Web
Function: Return the type of the color, which in turn determines which accessors are valid for this color.
Notes:
It's an exception-raising error to use properties that are not valid for a color; so, before using a given accessor on a color, call colorUsingType to convert the color to the appropriate type. Or, if wanting to use colorSpace-specific accessors such as redComponent, convert to the desired colorSpace with colorUsingColorSpace.

Note that as of macOS 10.13, the new APIs type and colorUsingType replace colorSpaceName and colorUsingColorSpaceName as the funnel APIs for determining the type of color. In code destined to run on 10.13 and newer systems, subclassers are encouraged to implement these two rather than the older colorSpaceName based methods.

Requires MacOS 10.13 or newer.
(Read only property)
NSColorMBS.whiteComponent as Double
Type Topic Plugin Version macOS Windows Linux iOS Targets
property Cocoa Drawing MBS MacBase Plugin 7.2 ✅ Yes ❌ No ❌ No ❌ No Desktop, Console & Web
Function: The color value from a Gray color.
Example:
dim c as NSColorMBS = NSColorMBS.colorWithDeviceWhite(0.1)
MsgBox str(c.whiteComponent)
Notes:
Value is from 0.0 to 1.0.
(Read only property)
NSColorMBS.yellowComponent as Double
Type Topic Plugin Version macOS Windows Linux iOS Targets
property Cocoa Drawing MBS MacBase Plugin 7.2 ✅ Yes ❌ No ❌ No ❌ No Desktop, Console & Web
Function: The color value from a CMYK color.
Example:
dim c as NSColorMBS = NSColorMBS.colorWithDeviceCMYK(0.1, 0.2, 0.3, 0.4)
MsgBox str(c.yellowComponent)
Notes:
Value is from 0.0 to 1.0.
(Read only property)

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


💬 Ask a question or report a problem
The biggest plugin in space...


Start Chat