Converting Red-Green-Blue to absolute colors
The colors used in MyRPL are absolute colors varying between
0 (black ) to 16777215 (white)
The following variable allows to convert a color from
Red Green Blue components to absolute numeric values.
Create the following variable in MyRPL:
<< 256 * + 256 * + >> enter
rgb
sto
To use the variable, enter first the red component to the stack
later the green component and later the blue component.
Each component could be in the range 0 to 255.
Example:
Find the numeric value of blue color:
0
enter
0
enter
255
rgb
Answer is 16711680
Find the numeric value of white color:
255
enter
255
enter
255
rgb
Answer is 16777215
Find the numeric value of green color:
0
enter
255
enter
0
enter
rgb
Answer is 65280