How Can We Help?
$rgb
Calculates the integer value of a RGB color by providing the corresponding Red, Green and Blue values.
Syntax
$rgb(Red Value, Green Value, Blue Value)
where
Red Value | an integer or an expression that evaluates to an integer between 0 and 255 |
Green Value | an integer or an expression that evaluates to an integer between 0 and 255 |
Blue Value | an integer or an expression that evaluates to an integer between 0 and 255 |
Return Value
A positive integer representing a RGB value.
Comments
Although the value returned is an integer, it inherently represents the internal representation of a given RGB combination based on the following example:
out $rgb(255, 0, 0) 16711680
In fact, this value internally means 0x00ff0000, accepted by any HTML syntax.
The great advantage of the function $rgb is to make available all RGB colors within Zim applications because, tradionally, Zim was only able to deal with very specific colors like Red, Light Blue, etc.
Example
To dynamically set a specific color to a particular form field:
$form set (fillcolor rgb $rgb(230, 40, 80)) MyForm.MyFormField