The htmlcolor( function converts a color name into a hex HTML color (RRGGBB format).


This function has one parameter:

color – the color name (or HTML RRGGBB color value).


This function converts a color name into a hex HTML color (in RRGGBB format). The name may be upper or lower case, and any spaces will be ignored.

htmlcolor("red") ☞ FF0000
htmlcolor("light blue") ☞ ADDEE7
htmlcolor("LIGHTBLUE") ☞ ADDEE7
htmlcolor("teal") ☞ 008484

The function will also pass thru any RRGGBB color passed to it, like this:

htmlcolor("ff00ff") ☞ FF00FF
htmlcolor("addee7") ☞ ADDEE7
htmlcolor("33CC33") ☞ 33CC33

If the specified color is not a valid color name or RRGGBB value, the function will return empty text. You can combine this with the defaulttext( function to return a default color of your choice, for example this formula will return light gray (“CCCCCC”) if the chosenColor variable doesn’t contain a valid color.


For a list of all available colors, use the info(“colornames”) function.

See Also


10.2NewNew in this version.