RGBComponent
- Last UpdatedOct 29, 2026
- 1 minute read
RGBComponent is a built-in scripting function that gets the level of a color component (red, green, or blue) in a specified color.
|
Function |
Group |
Execution |
String Exp. |
Windows |
Windows Embedded |
IoT View |
Thin Clients |
Mobile Access |
|---|---|---|---|---|---|---|---|---|
|
RGBComponent |
Graphic |
Synchronous |
Yes |
Supported |
Supported |
Supported |
Supported |
Supported |
Syntax
RGBComponent(numColor,numComponent)
numColor
The decimal code for a 24-bit RGB color, which can be any integer value between 0 and 16777215. (This color model is also known as "Truecolor" or "millions of colors.")
numComponent
The color component for which you want to get the level: 0 is red, 1 is green, and 2 is blue.
Returned value
This function returns an integer value between 0 or 255, which represents the level of the color component in the specified color.
Notes
For a list of frequently used RGB color codes and their equivalent "plain English" names, see Color Interface.
Examples
Get the level of red in color code 13434828 (that is, sea green):
RGBComponent( 13434828, 0 )
Get the level of the component specified by TagComponent in the color specified by TagCode:
RGBComponent( TagCode, TagComponent )