htmlcolor(
COLOR
)
The htmlcolor( function converts a color name into a hex HTML color (RRGGBB format).
Parameters
This function has one parameter:
color – the color name (or HTML RRGGBB color value).
Description
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.
defaulttext("CCCCCC",htmlcolor(chosenColor))
For a list of all available colors, use the info(“colornames”) function.
See Also
- alpha( -- extracts the alpha (opacity) from a color.
- black( -- returns black as a Panorama color value (see Colors).
- blue( -- extracts the blue intensity from a color.
- brightness( -- extracts the brightness from a color.
- Colors -- Using colors in Panorama formulas and procedures.
- colorwheel -- allows the user to pick a color using the operating systems standard color picker dialog
- formcolor -- changes the background color of the current form.
- getwebcolor( -- calculates an RGB color from a Netscape style web color.
- gray( -- returns a shade of gray as a Panorama color value (see Colors).
- green( -- extracts the green intensity from a color.
- hsb( -- creates a color by combining hue, saturation, and brightness components. See Colors.
- htmlcolorarray( -- generates a text array of HTML colors that gradually transition from one color to another.
- htmlrgb( -- converts text formatted as an HTML color into a Panorama color value (see Colors).
- htmlrgbstr( -- converts a color to text formatted as an HTML color.
- hue( -- extracts the hue from a color.
- info("colornames") -- returns a list of color names that can be used as a text object background and with the htmlcolor( function.
- info("formcolor") -- returns the background color of the current form.
- red( -- extracts the red intensity from a color.
- rgb( -- creates a color by combining red, green, and blue primary colors. See Colors.
- rgbstr( -- converts a color into text in the format *red,green,blue*.
- saturation( -- extracts the saturation from a color.
- white( -- returns white as a Panorama color value (see Colors).
History
10.2 | New | New in this version. |