This function is used by Ignition's Expression language.
This function tries to convert value to a color. It assumes that value is a string. If you have integers representing Red, Green, and Blue values see the color expression. The string value is converted to a color according to these rules:
If value is a name of a color as defined in the table below, the corresponding color will be returned. Note that color names are case insensitive.
If value is a hex color string (with or without a leading "#", the color equivalent of that hex string will be used. Examples: "#FF0000", "556B2F"
If value is a list of 3 or 4 integers, a color will be created that uses the first three integers as red, green, and blue values, and the optional fourth integer as an alpha channel value. All values should be between 0 and 255. The list is free-form, any non-digit characters may be used as delimiters between the digits. Examples: "(0,0,0)", "23-99-203", "[255,255,33,127]"
string value - The color value as a string.
object failover - Optional.The failover value if type casting fails.
Bool - The value type cast as a color object.
//All of these expressions return the color red.
//You can use the failover parameter to ensure that this expression returns something even if the input string may be bad:
This feature is new in Ignition version 7.9.8 Click here to check out the other new features
Both 'Grey' and 'Gray' are now accepted as valid colors as well as the iterations of that color such as 'DarkGrey' and 'DarkGray'.