Table of color names and values as recognized in IE4+, SVG, etc. Lookup of both names and values is implemented.
ColorNameTable | Table of color names and values as recognized in IE4+, SVG, etc. |
Color names | |
Color table properties | |
numColors | Number of colors defined in the color table. |
Lookup methods | |
lookupColorName | Looks up a color name for the given color value. |
lookupColorValue | Looks up a color value for the given color name. |
hasColorValue | Tests if the color value has a name defined. |
hasColorName | Tests if the color name is defined. |
Conversion | |
parseColor | Converts the string representing a color to a color value. |
toString | Converts the color value into a named or hexadecimal string representation. |
toHex | Converts the color value into a hexadecimal string representation. |
Internal reverse lookup table | |
values | Associative array of color values and names for reverse lookup |
Internal static class initialization | |
staticTypeInfo | Temporary used to hold type information about the class itself. |
colorName | Temporary used to hold the name of a color during initialization. |
public static function lookupColorValue( colorName: String ):uint
Looks up a color value for the given color name. The lookup is case insensitive. Name lookup can also be performed with the static properties on the class for example ColorNameTable.black.
color | a name of a defined color |
A color value or 0 (black) if the color name is not defined
public static function toString( color: uint ):String
Converts the color value into a named or hexadecimal string representation. If hex then the string is prefixed with 0x and contains 6 hexadecimal digits.
Color name or hexadecimal string representing the color in a form that is compatible with parseColor
public static function toHex( color: uint ):String
Converts the color value into a hexadecimal string representation. The string is prefixed with 0x and contains 6 hexadecimal digits.
Color name or hexadecimal string representing the color in a form that is compatible with parseColor
Number of colors defined in the color table.
public static var numColors: int
Looks up a color name for the given color value.
public static function lookupColorName( color: uint ):String
Looks up a color value for the given color name.
public static function lookupColorValue( colorName: String ):uint
Tests if the color value has a name defined.
public static function hasColorValue( color: uint ):Boolean
Tests if the color name is defined.
public static function hasColorName( colorName: String ):Boolean
Converts the string representing a color to a color value.
public static function parseColor( colorString: String ):uint
Converts the color value into a named or hexadecimal string representation.
public static function toString( color: uint ):String
Converts the color value into a hexadecimal string representation.
public static function toHex( color: uint ):String
Associative array of color values and names for reverse lookup
private static var values: Object
Temporary used to hold type information about the class itself.
private static var staticTypeInfo: XML
Temporary used to hold the name of a color during initialization.
private static var colorName: String