RGB - Built-in Miscellaneous Function¶
Purpose¶
Returns an integer value representing an RGB color value from a set of red, green, and blue color components.
Syntax¶
RGB(red, green, blue)
Arguments¶
| Argument | Required | Description |
|---|---|---|
red |
Yes | Any integer expression. The Red component of the color ranging from 0 to 255. |
green |
Yes | Any integer expression. The Green component of the color ranging from 0 to 255. |
blue |
Yes | Any integer expression. The Blue component of the color ranging from 0 to 255. |
Returns¶
Integer value
Example¶
let iRed = rgb(255, 0, 0)
let iGreen = rgb(0, 255, 0)
let iBlack = rgb(0, 0, 0)
if ({OrderHeader.Order_Total} > 0) then
return iGreen
else
if ({OrderHeader.Order_Total} < 0) then
return iRed
else
return iBlack
end
end
Notes¶
- If any color component exceeds 255, the value 255 is used.
- For a number of colors, a predefined constant can be used.