Click or drag to resize

RGB Function

X#
Get a particular Windows color.

Namespace:  XSharp.Core
Assembly:  XSharp.Core (in XSharp.Core.dll) Version: 2.21
Syntax
 FUNCTION RGB(
	bRed AS BYTE,
	bGreen AS BYTE,
	bBlue AS BYTE
) AS DWORD
Request Example View Source

Parameters

bRed
Type: Byte
The amount of red in the color, as a number from 0 to 255.
bGreen
Type: Byte
The amount of green in the color, as a number from 0 to 255.
bBlue
Type: Byte
The amount of blue in the color, as a number from 0 to 255.

Return Value

Type: DWord
The number that Windows uses to identify the color described.
Remarks
If all three arguments are specified as 0, the color is black.
If all three arguments are specified as 255, the color is white.
Examples
The following example identifies a color that is mostly red and green, with a little bit of blue:
X#
1RGB(225,225,50)
This example lists the RGB value of commonly used colors:
X#
 1? "Red", RGB(255, 0, 0)
 2? "Green", RGB(0, 255, 0)
 3? "Blue", RGB(0, 0, 255)
 4? "Yellow", RGB(255, 255, 0)
 5? "Magenta", RGB(255, 0, 255)
 6? "Cyan", RGB(0, 255, 255)
 7? "Black", RGB(0, 0, 0)
 8? "Gray", RGB(128, 128, 128)
 9? "Brown", RGB(128, 128, 0)
10? "Purple", RGB(128, 0, 128)
11? "Aqua", RGB(0, 128, 128)
See Also