Information.RGB Method
Returns an Integer value representing an RGB color value from a set of red, green and blue color components.
Namespace: Microsoft.VisualBasic
Assembly: Microsoft.VisualBasic (in Microsoft.VisualBasic.dll)
Parameters
- Red
- Type: System.Int32
Required. Integer in the range 0–255, inclusive, that represents the intensity of the red component of the color.
- Green
- Type: System.Int32
Required. Integer in the range 0–255, inclusive, that represents the intensity of the green component of the color.
- Blue
- Type: System.Int32
Required. Integer in the range 0–255, inclusive, that represents the intensity of the blue component of the color.
Return Value
Type: System.Int32Returns an Integer value representing an RGB color value from a set of red, green and blue color components.
| Exception | Condition |
|---|---|
| ArgumentException | Green, Blue, or Red is outside of range 0 to 255, inclusive. |
Application methods and properties that accept a color specification expect that specification to be a number representing an RGB color value. An RGB color value specifies the relative intensity of red, green, and blue to cause a specific color to be displayed.
If the value for any argument to RGB is greater than 255, 255 is used.
The following table lists some standard colors and the red, green, and blue values they include.
Color | Red value | Green value | Blue value |
|---|---|---|---|
Black | 0 | 0 | 0 |
Blue | 0 | 0 | 255 |
Green | 0 | 255 | 0 |
Cyan | 0 | 255 | 255 |
Red | 255 | 0 | 0 |
Magenta | 255 | 0 | 255 |
Yellow | 255 | 255 | 0 |
White | 255 | 255 | 255 |
Windows 8, Windows Server 2012, Windows 7, Windows Vista SP2, Windows Server 2008 (Server Core Role not supported), Windows Server 2008 R2 (Server Core Role supported with SP1 or later; Itanium not supported)
The .NET Framework does not support all versions of every platform. For a list of the supported versions, see .NET Framework System Requirements.