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
The alpha value of the color.
Example
dim c as NSColorMBS = NSColorMBS.blueColor
MsgBox str(c.alphaComponent)

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
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)

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
The color value from a RGB color.
Example
dim c as NSColorMBS = NSColorMBS.blueColor
MsgBox str(c.blueComponent)

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
The color value from a HSV color.
Example
dim c as NSColorMBS = NSColorMBS.colorWithDeviceHSV(0.1, 0.2, 0.3)
MsgBox str(c.brightnessComponent)

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
Returns the name of the catalog containing the receiver's name.

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
Returns the receiver's name.

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
Get the color space of the color.
Example
dim c as NSColorMBS = NSColorMBS.colorWithDeviceHSV(0.1, 0.2, 0.3)

MsgBox c.colorSpaceName

(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
Returns the color value of this color (ignoring color space).

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
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)

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
The description of the color object.
Example
dim n as NSColorMBS = NSColorMBS.blueColor

MsgBox n.description // shows "NSCalibratedRGBColorSpace 0 0 1 1"

(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
The color value from a RGB color.
Example
dim c as NSColorMBS = NSColorMBS.blueColor
MsgBox str(c.greenComponent)

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
The internal object reference.

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
The color value from a HSV color.
Example
dim c as NSColorMBS = NSColorMBS.colorWithDeviceHSV(0.1, 0.2, 0.3)
MsgBox str(c.hueComponent)

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
Returns the name of the catalog containing the receiver's name as a localized string.

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
Returns the name of the receiver as a localized string.

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
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)

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
Returns the number of components in the receiver.
Example
dim n as NSColorMBS = NSColorMBS.blueColor

MsgBox str(n.numberOfComponents) // shows 4

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
The color value from a RGB color.
Example
dim c as NSColorMBS = NSColorMBS.blueColor
MsgBox str(c.redComponent)

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
The color value from a HSV color.
Example
dim c as NSColorMBS = NSColorMBS.colorWithDeviceHSV(0.1, 0.2, 0.3)
MsgBox str(c.saturationComponent)

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
Return the type of the color, which in turn determines which accessors are valid for this color.

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
The color value from a Gray color.
Example
dim c as NSColorMBS = NSColorMBS.colorWithDeviceWhite(0.1)
MsgBox str(c.whiteComponent)

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
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)

Value is from 0.0 to 1.0.
(Read only property)

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


The biggest plugin in space...