< Day Day Up > |
RGB()Category: Text Formatting Syntax: RGB ( red ; green ; blue ) Parameters: red ”any number or numeric expression containing a value ranging from 0 to 255; green ”any number or numeric expression containing a value ranging from 0 to 255; blue ”any number or numeric expression containing a value ranging from 0 to 255. Description: Returns a number that represents a color . To calculate this integer, the red, green, and blue values are combined using the following formula: (red * 256 2 ) + (green * 256) + blue Examples: Table B.1 lists the RGB values of some common colors. Table B.1. RGB Values
Comments: Use the RGB() function in conjunction with the TextColor() function to format text. If a number above 255 is supplied as the parameter, the formula in the example still computes a result. If the result of the formula returns a value above the expected 0 to 16777215 range, the Mod (result; 16777216) is used to map the result into the expected range. So RGB (255; 255 ; 256) , which returns a value one higher than white, returns the color black, just as 0 does. |
< Day Day Up > |