Click or drag to resize

Color Constructor (DWord)

X#
Construct a color

Namespace:  XSharp.VO.SDK
Assembly:  XSharp.VOGUIClasses (in XSharp.VOGUIClasses.dll) Version: 2.19
Syntax
 CONSTRUCTOR(
	nColor AS DWORD
)
Request Example View Source

Parameters

nColor
Type: DWord
Construct a color using an single number. When the number <= then it is assumed to be be one of the predefined colors, such as ColorRed, ColorMagenta etc. Otherwise the color is the RGB number for the color.
Remarks
If the first and second argument are both numeric and the second argument is -1, X# will treat the first number as the colorref of the color object. In that case the first number indicates the standard color to create, specified as one of the following constants:
ConstantColor
COLORBLACKBlack
COLORBLUEBlue
COLORCYANCyan
COLORGREENGreen
COLORMAGENTAMagenta
COLORREDRed
COLORWHITEWhite
COLORYELLOWYellow
Examples
The following example defines some colors:
X#
1oRed                 := Color{COLORRED}
2oWhite        := Color{ 255, 255, 255}
3oMediumAquamarine  := Color{ 50, 204, 153}
4oBlack        := Color{  0,  0,  0}
5oBlue        := Color{  0,  0, 255}
6oCadetBlue      := Color{ 95, 159, 159}
7oCornflowerBlue   := Color{ 66, 66, 111}
8oDarkSlateBlue    := Color{ 107, 35, 142}
See Also