Platforms to show: All Mac Windows Linux Cross-Platform
Back to NSColorMBS class.
NSColorMBS.alphaComponent as Double
Function:
The alpha value of the color.
Example:
Notes:
Value is from 0.0 to 1.0.
(Read only property)
Type | Topic | Plugin | Version | macOS | Windows | Linux | iOS | Targets |
property | Cocoa Drawing | MBS MacBase Plugin | 7.2 | ✅ Yes | ❌ No | ❌ No | ❌ No | Desktop, Console & Web |
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
Function:
The color value from a CMYK color.
Example:
Notes:
Value is from 0.0 to 1.0.
(Read only property)
Type | Topic | Plugin | Version | macOS | Windows | Linux | iOS | Targets |
property | Cocoa Drawing | MBS MacBase Plugin | 7.2 | ✅ Yes | ❌ No | ❌ No | ❌ No | Desktop, Console & Web |
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
Function:
The color value from a RGB color.
Example:
Notes:
Value is from 0.0 to 1.0.
(Read only property)
Type | Topic | Plugin | Version | macOS | Windows | Linux | iOS | Targets |
property | Cocoa Drawing | MBS MacBase Plugin | 7.2 | ✅ Yes | ❌ No | ❌ No | ❌ No | Desktop, Console & Web |
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
Function:
The color value from a HSV color.
Example:
Notes:
Value is from 0.0 to 1.0.
(Read only property)
Type | Topic | Plugin | Version | macOS | Windows | Linux | iOS | Targets |
property | Cocoa Drawing | MBS MacBase Plugin | 7.2 | ✅ Yes | ❌ No | ❌ No | ❌ No | Desktop, Console & Web |
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
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)
Type | Topic | Plugin | Version | macOS | Windows | Linux | iOS | Targets |
property | Cocoa Drawing | MBS MacBase Plugin | 9.8 | ✅ Yes | ❌ No | ❌ No | ❌ No | Desktop, Console & Web |
Notes:
This method raises an exception if the receiver's color space isn't NSNamedColorSpace.
(Read only property)
NSColorMBS.colorNameComponent as string
Function:
Returns the receiver's name.
Notes:
This method raises an exception if the receiver's color space isn't NSNamedColorSpace.
(Read only property)
Type | Topic | Plugin | Version | macOS | Windows | Linux | iOS | Targets |
property | Cocoa Drawing | MBS MacBase Plugin | 9.8 | ✅ Yes | ❌ No | ❌ No | ❌ No | Desktop, Console & Web |
Notes:
This method raises an exception if the receiver's color space isn't NSNamedColorSpace.
(Read only property)
NSColorMBS.colorSpaceName as string
Function:
Get the color space of the color.
Example:
Notes:
(Read only property)
Type | Topic | Plugin | Version | macOS | Windows | Linux | iOS | Targets |
property | Cocoa Drawing | MBS MacBase Plugin | 7.2 | ✅ Yes | ❌ No | ❌ No | ✅ Yes | All |
Example:
dim c as NSColorMBS = NSColorMBS.colorWithDeviceHSV(0.1, 0.2, 0.3)
MsgBox c.colorSpaceName
NSColorMBS.colorValue as color
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)
Type | Topic | Plugin | Version | macOS | Windows | Linux | iOS | Targets |
property | Cocoa Drawing | MBS MacBase Plugin | 9.4 | ✅ Yes | ❌ No | ❌ No | ✅ Yes | All |
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
Function:
The color value from a CMYK color.
Example:
Notes:
Value is from 0.0 to 1.0.
(Read only property)
Type | Topic | Plugin | Version | macOS | Windows | Linux | iOS | Targets |
property | Cocoa Drawing | MBS MacBase Plugin | 7.2 | ✅ Yes | ❌ No | ❌ No | ❌ No | Desktop, Console & Web |
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
Function:
The description of the color object.
Example:
Notes:
(Read only property)
Type | Topic | Plugin | Version | macOS | Windows | Linux | iOS | Targets |
property | Cocoa Drawing | MBS MacBase Plugin | 9.8 | ✅ Yes | ❌ No | ❌ No | ✅ Yes | All |
Example:
dim n as NSColorMBS = NSColorMBS.blueColor
MsgBox n.description // shows "NSCalibratedRGBColorSpace 0 0 1 1"
NSColorMBS.greenComponent as Double
Function:
The color value from a RGB color.
Example:
Notes:
Value is from 0.0 to 1.0.
(Read only property)
Type | Topic | Plugin | Version | macOS | Windows | Linux | iOS | Targets |
property | Cocoa Drawing | MBS MacBase Plugin | 7.2 | ✅ Yes | ❌ No | ❌ No | ❌ No | Desktop, Console & Web |
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
Function:
The internal object reference.
Notes:
Useful for declares. Value is a NSColor pointer.
(Read and Write property)
Type | Topic | Plugin | Version | macOS | Windows | Linux | iOS | Targets |
property | Cocoa Drawing | MBS MacBase Plugin | 16.1 | ✅ Yes | ❌ No | ❌ No | ✅ Yes | All |
Notes:
Useful for declares. Value is a NSColor pointer.
(Read and Write property)
NSColorMBS.hueComponent as Double
Function:
The color value from a HSV color.
Example:
Notes:
Value is from 0.0 to 1.0.
(Read only property)
Type | Topic | Plugin | Version | macOS | Windows | Linux | iOS | Targets |
property | Cocoa Drawing | MBS MacBase Plugin | 7.2 | ✅ Yes | ❌ No | ❌ No | ❌ No | Desktop, Console & Web |
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
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)
Type | Topic | Plugin | Version | macOS | Windows | Linux | iOS | Targets |
property | Cocoa Drawing | MBS MacBase Plugin | 9.8 | ✅ Yes | ❌ No | ❌ No | ❌ No | Desktop, Console & Web |
Notes:
This string may be displayed in user interface items like color pickers.
(Read only property)
NSColorMBS.localizedColorNameComponent as string
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)
Type | Topic | Plugin | Version | macOS | Windows | Linux | iOS | Targets |
property | Cocoa Drawing | MBS MacBase Plugin | 9.8 | ✅ Yes | ❌ No | ❌ No | ❌ No | Desktop, Console & Web |
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
Function:
The color value from a CMYK color.
Example:
Notes:
Value is from 0.0 to 1.0.
(Read only property)
Type | Topic | Plugin | Version | macOS | Windows | Linux | iOS | Targets |
property | Cocoa Drawing | MBS MacBase Plugin | 7.2 | ✅ Yes | ❌ No | ❌ No | ❌ No | Desktop, Console & Web |
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
Function:
Returns the number of components in the receiver.
Example:
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)
Type | Topic | Plugin | Version | macOS | Windows | Linux | iOS | Targets |
property | Cocoa Drawing | MBS MacBase Plugin | 9.8 | ✅ Yes | ❌ No | ❌ No | ✅ Yes | All |
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
Function:
The color value from a RGB color.
Example:
Notes:
Value is from 0.0 to 1.0.
(Read only property)
Type | Topic | Plugin | Version | macOS | Windows | Linux | iOS | Targets |
property | Cocoa Drawing | MBS MacBase Plugin | 7.2 | ✅ Yes | ❌ No | ❌ No | ❌ No | Desktop, Console & Web |
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
Function:
The color value from a HSV color.
Example:
Notes:
Value is from 0.0 to 1.0.
(Read only property)
Type | Topic | Plugin | Version | macOS | Windows | Linux | iOS | Targets |
property | Cocoa Drawing | MBS MacBase Plugin | 7.2 | ✅ Yes | ❌ No | ❌ No | ❌ No | Desktop, Console & Web |
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
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)
Type | Topic | Plugin | Version | macOS | Windows | Linux | iOS | Targets |
property | Cocoa Drawing | MBS MacBase Plugin | 18.4 | ✅ Yes | ❌ No | ❌ No | ❌ No | Desktop, Console & Web |
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
Function:
The color value from a Gray color.
Example:
Notes:
Value is from 0.0 to 1.0.
(Read only property)
Type | Topic | Plugin | Version | macOS | Windows | Linux | iOS | Targets |
property | Cocoa Drawing | MBS MacBase Plugin | 7.2 | ✅ Yes | ❌ No | ❌ No | ❌ No | Desktop, Console & Web |
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
Function:
The color value from a CMYK color.
Example:
Notes:
Value is from 0.0 to 1.0.
(Read only property)
Type | Topic | Plugin | Version | macOS | Windows | Linux | iOS | Targets |
property | Cocoa Drawing | MBS MacBase Plugin | 7.2 | ✅ Yes | ❌ No | ❌ No | ❌ No | Desktop, Console & Web |
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.
