Posted By

adrianparr on 12/24/10


Tagged

name colour color as3 keywords html4 colorname


Versions (?)

AS3 HTML Color Keywords (ColorName Class)


 / Published in: ActionScript 3
 

URL: http://yourpalmark.com/2008/06/20/color-name-class-svg-10-x11-and-vga/

All credit for this class goes to Mark Walters (www.yourpalmark.com)

This class needs to be put in the package structure "com/yourpalmark/utils"

  1. /*
  2. Copyright (c) 2009 Mark Walters
  3.  
  4. Permission is hereby granted, free of charge, to any person obtaining a copy
  5. of this software and associated documentation files (the "Software"), to deal
  6. in the Software without restriction, including without limitation the rights
  7. to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
  8. copies of the Software, and to permit persons to whom the Software is
  9. furnished to do so, subject to the following conditions:
  10.  
  11. The above copyright notice and this permission notice shall be included in
  12. all copies or substantial portions of the Software.
  13.  
  14. THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
  15. IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
  16. FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
  17. AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
  18. LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
  19. OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN
  20. THE SOFTWARE.
  21. */
  22.  
  23. package com.yourpalmark.utils
  24. {
  25. import flash.utils.Dictionary;
  26.  
  27. /**
  28. * The ColorName class defines the names and hexadecimal values of the colors defined in SVG 1.0.
  29. * The colors include the X11 colors supported by popular browsers with the addition of gray/grey variants from SVG 1.0.
  30. * The resulting list is precisely the same as the SVG 1.0 color keyword names.
  31. * The SVG 1.0 colors include the HTML4 colors, based on the VGA colors.
  32. * @see http://www.w3.org/TR/css3-color/#html4
  33. * @see http://www.w3.org/TR/css3-color/#svg-color
  34. *
  35. * @author Mark Walters
  36. */
  37. public class ColorName
  38. {
  39. //HTML4 COLOR KEYWORDS - VGA
  40. //@see http://www.w3.org/TR/css3-color/#html4
  41. public static const AQUA:ColorName = new ColorName( "aqua", 0x00FFFF );
  42. public static const BLACK:ColorName = new ColorName( "black", 0x000000 );
  43. public static const BLUE:ColorName = new ColorName( "blue", 0x0000FF );
  44. public static const FUCHSIA:ColorName = new ColorName( "fuchsia", 0xFF00FF );
  45. public static const GRAY:ColorName = new ColorName( "gray", 0x808080 );
  46. public static const GREEN:ColorName = new ColorName( "green", 0x008000 );
  47. public static const LIME:ColorName = new ColorName( "lime", 0x00FF00 );
  48. public static const MAROON:ColorName = new ColorName( "maroon", 0x800000 );
  49. public static const NAVY:ColorName = new ColorName( "navy", 0x000080 );
  50. public static const OLIVE:ColorName = new ColorName( "olive", 0x808000 );
  51. public static const PURPLE:ColorName = new ColorName( "purple", 0x800080 );
  52. public static const RED:ColorName = new ColorName( "red", 0xFF0000 );
  53. public static const SILVER:ColorName = new ColorName( "silver", 0xC0C0C0 );
  54. public static const TEAL:ColorName = new ColorName( "teal", 0x008080 );
  55. public static const WHITE:ColorName = new ColorName( "white", 0xFFFFFF );
  56. public static const YELLOW:ColorName = new ColorName( "yellow", 0xFFFF00 );
  57.  
  58. //SVG COLOR KEYWORDS - X11 ( INCLUDES THE 16 HTML4 - VGA COLORS )
  59. //@see http://www.w3.org/TR/css3-color/#svg-color
  60. public static const ALICE_BLUE:ColorName = new ColorName( "aliceBlue", 0xF0F8FF );
  61. public static const ANTIQUE_WHITE:ColorName = new ColorName( "antiqueWhite", 0xFAEBD7 );
  62. public static const AQUAMARINE:ColorName = new ColorName( "aquamarine", 0x7FFFD4 );
  63. public static const AZURE:ColorName = new ColorName( "azure", 0xF0FFFF );
  64. public static const BEIGE:ColorName = new ColorName( "beige", 0xF5F5DC );
  65. public static const BISQUE:ColorName = new ColorName( "bisque", 0xFFE4C4 );
  66. public static const BLANCHED_ALMOND:ColorName = new ColorName( "blanchedAlmond", 0xFFEBCD );
  67. public static const BLUE_VIOLET:ColorName = new ColorName( "blueViolet", 0x8A2BE2 );
  68. public static const BROWN:ColorName = new ColorName( "brown", 0xA52A2A );
  69. public static const BURLY_WOOD:ColorName = new ColorName( "burlyWood", 0xDEB887 );
  70. public static const CADET_BLUE:ColorName = new ColorName( "cadetBlue", 0x5F9EA0 );
  71. public static const CHARTREUSE:ColorName = new ColorName( "chartreuse", 0x7FFF00 );
  72. public static const CHOCOLATE:ColorName = new ColorName( "chocolate", 0xD2691E );
  73. public static const CORAL:ColorName = new ColorName( "coral", 0xFF7F50 );
  74. public static const CORNFLOWER_BLUE:ColorName = new ColorName( "cornflowerBlue", 0x6495ED );
  75. public static const CORNSILK:ColorName = new ColorName( "cornsilk", 0xFFF8DC );
  76. public static const CRIMSON:ColorName = new ColorName( "crimson", 0xDC143C );
  77. public static const CYAN:ColorName = new ColorName( "cyan", 0x00FFFF );
  78. public static const DARK_BLUE:ColorName = new ColorName( "darkBlue", 0x00008B );
  79. public static const DARK_CYAN:ColorName = new ColorName( "darkCyan", 0x008B8B );
  80. public static const DARK_GOLDEN_ROD:ColorName = new ColorName( "darkGoldenRod", 0xB8860B );
  81. public static const DARK_GRAY:ColorName = new ColorName( "darkGray", 0xA9A9A9 );
  82. public static const DARK_GREY:ColorName = new ColorName( "darkGrey", 0xA9A9A9 );
  83. public static const DARK_GREEN:ColorName = new ColorName( "darkGreen", 0x006400 );
  84. public static const DARK_KHAKI:ColorName = new ColorName( "darkKhaki", 0xBDB76B );
  85. public static const DARK_MAGENTA:ColorName = new ColorName( "darkMagenta", 0x8B008B );
  86. public static const DARK_OLIVE_GREEN:ColorName = new ColorName( "darkOliveGreen", 0x556B2F );
  87. public static const DARK_ORANGE:ColorName = new ColorName( "darkOrange", 0xFF8C00 );
  88. public static const DARK_ORCHID:ColorName = new ColorName( "darkOrchid", 0x9932CC );
  89. public static const DARK_RED:ColorName = new ColorName( "darkRed", 0x8B0000 );
  90. public static const DARK_SALMON:ColorName = new ColorName( "darkSalmon", 0xE9967A );
  91. public static const DARK_SEA_GREEN:ColorName = new ColorName( "darkSeaGreen", 0x8FBC8F );
  92. public static const DARK_SLATE_BLUE:ColorName = new ColorName( "darkSlateBlue", 0x483D8B );
  93. public static const DARK_SLATE_GRAY:ColorName = new ColorName( "darkSlateGray", 0x2F4F4F );
  94. public static const DARK_SLATE_GREY:ColorName = new ColorName( "darkSlateGrey", 0x2F4F4F );
  95. public static const DARK_TURQUOISE:ColorName = new ColorName( "darkTurquoise", 0x00CED1 );
  96. public static const DARK_VIOLET:ColorName = new ColorName( "darkViolet", 0x9400D3 );
  97. public static const DEEP_PINK:ColorName = new ColorName( "deepPink", 0xFF1493 );
  98. public static const DEEP_SKY_BLUE:ColorName = new ColorName( "deepSkyBlue", 0x00BFFF );
  99. public static const DIM_GRAY:ColorName = new ColorName( "dimGray", 0x696969 );
  100. public static const DIM_GREY:ColorName = new ColorName( "dimGrey", 0x696969 );
  101. public static const DODGER_BLUE:ColorName = new ColorName( "dodgerBlue", 0x1E90FF );
  102. public static const FIRE_BRICK:ColorName = new ColorName( "fireBrick", 0xB22222 );
  103. public static const FLORAL_WHITE:ColorName = new ColorName( "floralWhite", 0xFFFAF0 );
  104. public static const FOREST_GREEN:ColorName = new ColorName( "forestGreen", 0x228B22 );
  105. public static const GAINSBORO:ColorName = new ColorName( "gainsboro", 0xDCDCDC );
  106. public static const GHOST_WHITE:ColorName = new ColorName( "ghostWhite", 0xF8F8FF );
  107. public static const GOLD:ColorName = new ColorName( "gold", 0xFFD700 );
  108. public static const GOLDEN_ROD:ColorName = new ColorName( "goldenRod", 0xDAA520 );
  109. public static const GREY:ColorName = new ColorName( "grey", 0x808080 );
  110. public static const GREEN_YELLOW:ColorName = new ColorName( "greenYellow", 0xADFF2F );
  111. public static const HONEY_DEW:ColorName = new ColorName( "honeyDew", 0xF0FFF0 );
  112. public static const HOT_PINK:ColorName = new ColorName( "hotPink", 0xFF69B4 );
  113. public static const INDIAN_RED:ColorName = new ColorName( "indianRed", 0xCD5C5C );
  114. public static const INDIGO:ColorName = new ColorName( "indigo", 0x4B0082 );
  115. public static const IVORY:ColorName = new ColorName( "ivory", 0xFFFFF0 );
  116. public static const KHAKI:ColorName = new ColorName( "khaki", 0xF0E68C );
  117. public static const LAVENDER:ColorName = new ColorName( "lavender", 0xE6E6FA );
  118. public static const LAVENDER_BLUSH:ColorName = new ColorName( "lavenderBlush", 0xFFF0F5 );
  119. public static const LAWN_GREEN:ColorName = new ColorName( "lawnGreen", 0x7CFC00 );
  120. public static const LEMON_CHIFFON:ColorName = new ColorName( "lemonChiffon", 0xFFFACD );
  121. public static const LIGHT_BLUE:ColorName = new ColorName( "lightBlue", 0xADD8E6 );
  122. public static const LIGHT_CORAL:ColorName = new ColorName( "lightCoral", 0xF08080 );
  123. public static const LIGHT_CYAN:ColorName = new ColorName( "lightCyan", 0xE0FFFF );
  124. public static const LIGHT_GOLDEN_ROD_YELLOW:ColorName = new ColorName( "lightGoldenRodYellow", 0xFAFAD2 );
  125. public static const LIGHT_GRAY:ColorName = new ColorName( "lightGray", 0xD3D3D3 );
  126. public static const LIGHT_GREY:ColorName = new ColorName( "lightGrey", 0xD3D3D3 );
  127. public static const LIGHT_GREEN:ColorName = new ColorName( "lightGreen", 0x90EE90 );
  128. public static const LIGHT_PINK:ColorName = new ColorName( "lightPink", 0xFFB6C1 );
  129. public static const LIGHT_SALMON:ColorName = new ColorName( "lightSalmon", 0xFFA07A );
  130. public static const LIGHT_SEA_GREEN:ColorName = new ColorName( "lightSeaGreen", 0x20B2AA );
  131. public static const LIGHT_SKY_BLUE:ColorName = new ColorName( "lightSkyBlue", 0x87CEFA );
  132. public static const LIGHT_SLATE_GRAY:ColorName = new ColorName( "lightSlateGray", 0x778899 );
  133. public static const LIGHT_SLATE_GREY:ColorName = new ColorName( "lightSlateGrey", 0x778899 );
  134. public static const LIGHT_STEEL_BLUE:ColorName = new ColorName( "lightSteelBlue", 0xB0C4DE );
  135. public static const LIGHT_YELLOW:ColorName = new ColorName( "lightYellow", 0xFFFFE0 );
  136. public static const LIME_GREEN:ColorName = new ColorName( "limeGreen", 0x32CD32 );
  137. public static const LINEN:ColorName = new ColorName( "linen", 0xFAF0E6 );
  138. public static const MAGENTA:ColorName = new ColorName( "magenta", 0xFF00FF );
  139. public static const MEDIUM_AQUA_MARINE:ColorName = new ColorName( "mediumAquaMarine", 0x66CDAA );
  140. public static const MEDIUM_BLUE:ColorName = new ColorName( "mediumBlue", 0x0000CD );
  141. public static const MEDIUM_ORCHID:ColorName = new ColorName( "mediumOrchid", 0xBA55D3 );
  142. public static const MEDIUM_PURPLE:ColorName = new ColorName( "mediumPurple", 0x9370D8 );
  143. public static const MEDIUM_SEA_GREEN:ColorName = new ColorName( "mediumSeaGreen", 0x3CB371 );
  144. public static const MEDIUM_SLATE_BLUE:ColorName = new ColorName( "mediumSlateBlue", 0x7B68EE );
  145. public static const MEDIUM_SPRING_GREEN:ColorName = new ColorName( "mediumSpringGreen", 0x00FA9A );
  146. public static const MEDIUM_TURQUOISE:ColorName = new ColorName( "mediumTurquoise", 0x48D1CC );
  147. public static const MEDIUM_VIOLET_RED:ColorName = new ColorName( "mediumVioletRed", 0xC71585 );
  148. public static const MIDNIGHT_BLUE:ColorName = new ColorName( "midnightBlue", 0x191970 );
  149. public static const MINT_CREAM:ColorName = new ColorName( "mintCream", 0xF5FFFA );
  150. public static const MISTY_ROSE:ColorName = new ColorName( "mistyRose", 0xFFE4E1 );
  151. public static const MOCCASIN:ColorName = new ColorName( "moccasin", 0xFFE4B5 );
  152. public static const NAVAJO_WHITE:ColorName = new ColorName( "navajoWhite", 0xFFDEAD );
  153. public static const OLD_LACE:ColorName = new ColorName( "oldLace", 0xFDF5E6 );
  154. public static const OLIVE_DRAB:ColorName = new ColorName( "oliveDrab", 0x6B8E23 );
  155. public static const ORANGE:ColorName = new ColorName( "orange", 0xFFA500 );
  156. public static const ORANGE_RED:ColorName = new ColorName( "orangeRed", 0xFF4500 );
  157. public static const ORCHID:ColorName = new ColorName( "orchid", 0xDA70D6 );
  158. public static const PALE_GOLDEN_ROD:ColorName = new ColorName( "paleGoldenRod", 0xEEE8AA );
  159. public static const PALE_GREEN:ColorName = new ColorName( "paleGreen", 0x98FB98 );
  160. public static const PALE_TURQUOISE:ColorName = new ColorName( "paleTurquoise", 0xAFEEEE );
  161. public static const PALE_VIOLET_RED:ColorName = new ColorName( "paleVioletRed", 0xD87093 );
  162. public static const PAPAYA_WHIP:ColorName = new ColorName( "papayaWhip", 0xFFEFD5 );
  163. public static const PEACH_PUFF:ColorName = new ColorName( "peachPuff", 0xFFDAB9 );
  164. public static const PERU:ColorName = new ColorName( "peru", 0xCD853F );
  165. public static const PINK:ColorName = new ColorName( "pink", 0xFFC0CB );
  166. public static const PLUM:ColorName = new ColorName( "plum", 0xDDA0DD );
  167. public static const POWDER_BLUE:ColorName = new ColorName( "powderBlue", 0xB0E0E6 );
  168. public static const ROSY_BROWN:ColorName = new ColorName( "rosyBrown", 0xBC8F8F );
  169. public static const ROYAL_BLUE:ColorName = new ColorName( "royalBlue", 0x4169E1 );
  170. public static const SADDLE_BROWN:ColorName = new ColorName( "saddleBrown", 0x8B4513 );
  171. public static const SALMON:ColorName = new ColorName( "salmon", 0xFA8072 );
  172. public static const SANDY_BROWN:ColorName = new ColorName( "sandyBrown", 0xF4A460 );
  173. public static const SEA_GREEN:ColorName = new ColorName( "seaGreen", 0x2E8B57 );
  174. public static const SEA_SHELL:ColorName = new ColorName( "seaShell", 0xFFF5EE );
  175. public static const SIENNA:ColorName = new ColorName( "sienna", 0xA0522D );
  176. public static const SKY_BLUE:ColorName = new ColorName( "skyBlue", 0x87CEEB );
  177. public static const SLATE_BLUE:ColorName = new ColorName( "slateBlue", 0x6A5ACD );
  178. public static const SLATE_GRAY:ColorName = new ColorName( "slateGray", 0x708090 );
  179. public static const SLATE_GREY:ColorName = new ColorName( "slateGrey", 0x708090 );
  180. public static const SNOW:ColorName = new ColorName( "snow", 0xFFFAFA );
  181. public static const SPRING_GREEN:ColorName = new ColorName( "springGreen", 0x00FF7F );
  182. public static const STEEL_BLUE:ColorName = new ColorName( "steelBlue", 0x4682B4 );
  183. public static const TAN:ColorName = new ColorName( "tan", 0xD2B48C );
  184. public static const THISTLE:ColorName = new ColorName( "thistle", 0xD8BFD8 );
  185. public static const TOMATO:ColorName = new ColorName( "tomato", 0xFF6347 );
  186. public static const TURQUOISE:ColorName = new ColorName( "turquoise", 0x40E0D0 );
  187. public static const VIOLET:ColorName = new ColorName( "violet", 0xEE82EE );
  188. public static const WHEAT:ColorName = new ColorName( "wheat", 0xF5DEB3 );
  189. public static const WHITE_SMOKE:ColorName = new ColorName( "whiteSmoke", 0xF5F5F5 );
  190. public static const YELLOW_GREEN:ColorName = new ColorName( "yellowGreen", 0x9ACD32 );
  191.  
  192. /**
  193. * @private
  194. */
  195. protected static var nameDict:Dictionary;
  196.  
  197. /**
  198. * @private
  199. */
  200. protected static var colorDict:Dictionary;
  201.  
  202. /**
  203. * @private
  204. */
  205. private var _name:String;
  206.  
  207. /**
  208. * @private
  209. */
  210. private var _color:uint;
  211.  
  212. /**
  213. * Constructor.
  214. *
  215. * @param name The string name of a color (case-insensitive).
  216. * @param color The hexadecimal value of a color.
  217. */
  218. public function ColorName( name:String, color:uint )
  219. {
  220. if( !nameDict ) nameDict = new Dictionary();
  221. if( !colorDict ) colorDict = new Dictionary();
  222.  
  223. this.name = name;
  224. this.color = color;
  225. }
  226.  
  227. /**
  228. * The string name of a color (case-insensitive).
  229. */
  230. public function get name():String
  231. {
  232. return _name;
  233. }
  234.  
  235. /**
  236. * @private
  237. */
  238. public function set name( value:String ):void
  239. {
  240. _name = value;
  241. nameDict[ value.toLowerCase() ] = this;
  242. }
  243.  
  244. /**
  245. * The hexadecimal value of a color.
  246. */
  247. public function get color():uint
  248. {
  249. return _color;
  250. }
  251.  
  252. /**
  253. * @private
  254. */
  255. public function set color( value:uint ):void
  256. {
  257. _color = value;
  258. colorDict[ value ] = this;
  259. }
  260.  
  261. /**
  262. * Returns the corresponding ColorName object from the string name.
  263. *
  264. * @param name The string name of a color (case-insensitive).
  265. * @return A ColorName object.
  266. */
  267. public static function getColorNameByName( name:String ):ColorName
  268. {
  269. return nameDict[ name.toLowerCase() ];
  270. }
  271.  
  272. /**
  273. * Returns the corresponding ColorName object from the hexadecimal value.
  274. *
  275. * @param color The hexadecimal value of a color.
  276. * @return A ColorName object.
  277. */
  278. public static function getColorNameByColor( color:uint ):ColorName
  279. {
  280. return colorDict[ color ];
  281. }
  282.  
  283. /**
  284. * Returns a string containing all the properties of the ColorName object.
  285. */
  286. public function toString():String
  287. {
  288. var colorString:String = color.toString( 16 ).toUpperCase();
  289. while( 6 > colorString.length ) colorString = "0" + colorString;
  290. return "[ColorName name=\"" + name + "\" color=0x" + colorString + "]";
  291. }
  292.  
  293. }
  294. }
  295.  
  296.  
  297.  
  298. // Usage example ...
  299. //
  300. // package
  301. // {
  302. // import flash.display.Sprite;
  303. // import com.yourpalmark.utils.ColorName;
  304. //
  305. // public class Main extends Sprite
  306. // {
  307. // private var canvas:Sprite;
  308. //
  309. // public function Main():void
  310. // {
  311. // canvas = new Sprite();
  312. // canvas.graphics.beginFill(ColorName.LAVENDER_BLUSH.color, 1);
  313. // canvas.graphics.drawRect(0, 0, 500, 250);
  314. // canvas.graphics.endFill();
  315. // addChild(canvas);
  316. // }
  317. //
  318. // }
  319. //
  320. // }

Report this snippet  

Comments

RSS Icon Subscribe to comments
Posted By: burnandbass on December 26, 2010

I got something like this:

package bab.utils{ import flash.errors.*; public class Colors { static private var colors:Hash = new Hash( { "aqua": 0x00ffff, "black": 0x000000, "blue": 0x0000ff, "brown": 0xa52a2a, "cyan": 0x00ffff, "darkblue": 0x00008b, "darkcyan": 0x008b8b, "darkgray": 0xa9a9a9, "darkgrey": 0xa9a9a9, "darkgreen": 0x006400, "darkmagenta": 0x8b008b, "darkred": 0x8b0000, "deeppink": 0xff1493, "gold": 0xffd700, "gray": 0x808080, "grey": 0x808080, "green": 0x008000, "greenyellow": 0xadff2f, "lightblue": 0xadd8e6, "lightcyan": 0xe0ffff, "lightgray": 0xd3d3d3, "lightgrey": 0xd3d3d3, "lightgreen": 0x90ee90, "lightpink": 0xffb6c1, "lightyellow": 0xffffe0, "lime": 0x00ff00, "limegreen": 0x32cd32, "magenta": 0xff00ff, "pink": 0xffc0cb, "red": 0xff0000, "yellow": 0xffff00, "white": 0xffffff });

    static public const TYPE_INT:String = "int";
    static public const TYPE_HTML:String = "html";

    public function Colors(){
        throw new Error("this is for using with static methods only");
        }

    public static function setColors(colors:Object):void {
        for (var n:String in colors){
            Colors.set(n,colors[n]);
        }
    }

    static public function set(name:String, c:*):void {
        if (c is String) {
            var color_num:Array = (c as String).toUpperCase().match(/^\#?([\dA-F]+)$/);
            if (color_num) {
                colors[name] = Number("0x"+color_num[1]);
            }else {
                colors[name] = get(c);
            }
        }else {
            colors[name] = c;
        }
    }

    static public function convertColors(hash:Hash, type:String = "int"):Hash {
        for ( var n:String in hash){
            if(n == "_color" || n == "color" || n == "backgroundColor" || n == "borderColor" || n == "_text_color"){
                hash[n] = Colors.get(hash[n],type);
            }
        }
        return hash;
    }

    static public function get(name:*, type:String = "int"):* {
        if(!(name is String)){
            return name;
        }
        switch(type) {
            case TYPE_HTML:
                return "#" + colors[name].toString(16);
            break;
            case TYPE_INT:
            default :
                return colors[name];
        }
    }
}

}

Posted By: mgeduld on January 19, 2011

Thanks. This is really useful. I only wanted the colors as straight-forward consts, so I ran a RegExp on your list and came up with what's below (adding grays at the top)

public static const NO_COLOR : int = -1;

//grays public static const GRAY10: int = 0x1A1A1A; public static const GRAY20: int = 0x333333; public static const GRAY30: int = 0x4D4D4D; public static const GRAY40: int = 0x666666; public static const GRAY50: int = 0x808080; public static const GRAY60: int = 0x999999; public static const GRAY70: int = 0xB3B3B3; public static const GRAY80: int = 0xCCCCCC; public static const GRAY90: int = 0xE5E5E5;

//HTML4 COLOR KEYWORDS - VGA //@see http://www.w3.org/TR/css3-color/#html4 public static const AQUA : int = 0x00FFFF; public static const BLACK : int = 0x000000; public static const BLUE : int = 0x0000FF; public static const FUCHSIA : int = 0xFF00FF; public static const GRAY : int = 0x808080; public static const GREEN : int = 0x008000; public static const LIME : int = 0x00FF00; public static const MAROON : int = 0x800000; public static const NAVY : int = 0x000080; public static const OLIVE : int = 0x808000; public static const PURPLE : int = 0x800080; public static const RED : int = 0xFF0000; public static const SILVER : int = 0xC0C0C0; public static const TEAL : int = 0x008080; public static const WHITE : int = 0xFFFFFF; public static const YELLOW : int = 0xFFFF00;

//SVG COLOR KEYWORDS - X11 ( INCLUDES THE 16 HTML4 - VGA COLORS ) //@see http://www.w3.org/TR/css3-color/#svg-color public static const ALICEBLUE : int = 0xF0F8FF; public static const ANTIQUEWHITE : int = 0xFAEBD7; public static const AQUAMARINE : int = 0x7FFFD4; public static const AZURE : int = 0xF0FFFF; public static const BEIGE : int = 0xF5F5DC; public static const BISQUE : int = 0xFFE4C4; public static const BLANCHEDALMOND : int = 0xFFEBCD; public static const BLUEVIOLET : int = 0x8A2BE2; public static const BROWN : int = 0xA52A2A; public static const BURLYWOOD : int = 0xDEB887; public static const CADETBLUE : int = 0x5F9EA0; public static const CHARTREUSE : int = 0x7FFF00; public static const CHOCOLATE : int = 0xD2691E; public static const CORAL : int = 0xFF7F50; public static const CORNFLOWERBLUE : int = 0x6495ED; public static const CORNSILK : int = 0xFFF8DC; public static const CRIMSON : int = 0xDC143C; public static const CYAN : int = 0x00FFFF; public static const DARKBLUE : int = 0x00008B; public static const DARKCYAN : int = 0x008B8B; public static const DARKGOLDENROD : int = 0xB8860B; public static const DARKGRAY : int = 0xA9A9A9; public static const DARKGREY : int = 0xA9A9A9; public static const DARKGREEN : int = 0x006400; public static const DARKKHAKI : int = 0xBDB76B; public static const DARKMAGENTA : int = 0x8B008B; public static const DARKOLIVEGREEN : int = 0x556B2F; public static const DARKORANGE : int = 0xFF8C00; public static const DARKORCHID : int = 0x9932CC; public static const DARKRED : int = 0x8B0000; public static const DARKSALMON : int = 0xE9967A; public static const DARKSEAGREEN : int = 0x8FBC8F; public static const DARKSLATEBLUE : int = 0x483D8B; public static const DARKSLATEGRAY : int = 0x2F4F4F; public static const DARKSLATEGREY : int = 0x2F4F4F; public static const DARKTURQUOISE : int = 0x00CED1; public static const DARKVIOLET : int = 0x9400D3; public static const DEEPPINK : int = 0xFF1493; public static const DEEPSKYBLUE : int = 0x00BFFF; public static const DIMGRAY : int = 0x696969; public static const DIMGREY : int = 0x696969; public static const DODGERBLUE : int = 0x1E90FF; public static const FIREBRICK : int = 0xB22222; public static const FLORALWHITE : int = 0xFFFAF0; public static const FORESTGREEN : int = 0x228B22; public static const GAINSBORO : int = 0xDCDCDC; public static const GHOSTWHITE : int = 0xF8F8FF; public static const GOLD : int = 0xFFD700; public static const GOLDENROD : int = 0xDAA520; public static const GREY : int = 0x808080; public static const GREENYELLOW : int = 0xADFF2F; public static const HONEYDEW : int = 0xF0FFF0; public static const HOTPINK : int = 0xFF69B4; public static const INDIANRED : int = 0xCD5C5C; public static const INDIGO : int = 0x4B0082; public static const IVORY : int = 0xFFFFF0; public static const KHAKI : int = 0xF0E68C; public static const LAVENDER : int = 0xE6E6FA; public static const LAVENDERBLUSH : int = 0xFFF0F5; public static const LAWNGREEN : int = 0x7CFC00; public static const LEMONCHIFFON : int = 0xFFFACD; public static const LIGHTBLUE : int = 0xADD8E6; public static const LIGHTCORAL : int = 0xF08080; public static const LIGHTCYAN : int = 0xE0FFFF; public static const LIGHTGOLDENRODYELLOW : int = 0xFAFAD2; public static const LIGHTGRAY : int = 0xD3D3D3; public static const LIGHTGREY : int = 0xD3D3D3; public static const LIGHTGREEN : int = 0x90EE90; public static const LIGHTPINK : int = 0xFFB6C1; public static const LIGHTSALMON : int = 0xFFA07A; public static const LIGHTSEAGREEN : int = 0x20B2AA; public static const LIGHTSKYBLUE : int = 0x87CEFA; public static const LIGHTSLATEGRAY : int = 0x778899; public static const LIGHTSLATEGREY : int = 0x778899; public static const LIGHTSTEELBLUE : int = 0xB0C4DE; public static const LIGHTYELLOW : int = 0xFFFFE0; public static const LIMEGREEN : int = 0x32CD32; public static const LINEN : int = 0xFAF0E6; public static const MAGENTA : int = 0xFF00FF; public static const MEDIUMAQUAMARINE : int = 0x66CDAA; public static const MEDIUMBLUE : int = 0x0000CD; public static const MEDIUMORCHID : int = 0xBA55D3; public static const MEDIUMPURPLE : int = 0x9370D8; public static const MEDIUMSEAGREEN : int = 0x3CB371; public static const MEDIUMSLATEBLUE : int = 0x7B68EE; public static const MEDIUMSPRINGGREEN : int = 0x00FA9A; public static const MEDIUMTURQUOISE : int = 0x48D1CC; public static const MEDIUMVIOLETRED : int = 0xC71585; public static const MIDNIGHTBLUE : int = 0x191970; public static const MINTCREAM : int = 0xF5FFFA; public static const MISTYROSE : int = 0xFFE4E1; public static const MOCCASIN : int = 0xFFE4B5; public static const NAVAJOWHITE : int = 0xFFDEAD; public static const OLDLACE : int = 0xFDF5E6; public static const OLIVEDRAB : int = 0x6B8E23; public static const ORANGE : int = 0xFFA500; public static const ORANGERED : int = 0xFF4500; public static const ORCHID : int = 0xDA70D6; public static const PALEGOLDENROD : int = 0xEEE8AA; public static const PALEGREEN : int = 0x98FB98; public static const PALETURQUOISE : int = 0xAFEEEE; public static const PALEVIOLETRED : int = 0xD87093; public static const PAPAYAWHIP : int = 0xFFEFD5; public static const PEACHPUFF : int = 0xFFDAB9; public static const PERU : int = 0xCD853F; public static const PINK : int = 0xFFC0CB; public static const PLUM : int = 0xDDA0DD; public static const POWDERBLUE : int = 0xB0E0E6; public static const ROSYBROWN : int = 0xBC8F8F; public static const ROYALBLUE : int = 0x4169E1; public static const SADDLEBROWN : int = 0x8B4513; public static const SALMON : int = 0xFA8072; public static const SANDYBROWN : int = 0xF4A460; public static const SEAGREEN : int = 0x2E8B57; public static const SEASHELL : int = 0xFFF5EE; public static const SIENNA : int = 0xA0522D; public static const SKYBLUE : int = 0x87CEEB; public static const SLATEBLUE : int = 0x6A5ACD; public static const SLATEGRAY : int = 0x708090; public static const SLATEGREY : int = 0x708090; public static const SNOW : int = 0xFFFAFA; public static const SPRINGGREEN : int = 0x00FF7F; public static const STEELBLUE : int = 0x4682B4; public static const TAN : int = 0xD2B48C; public static const THISTLE : int = 0xD8BFD8; public static const TOMATO : int = 0xFF6347; public static const TURQUOISE : int = 0x40E0D0; public static const VIOLET : int = 0xEE82EE; public static const WHEAT : int = 0xF5DEB3; public static const WHITESMOKE : int = 0xF5F5F5; public static const YELLOW_GREEN : int = 0x9ACD32;

Posted By: mgeduld on January 19, 2011

Yikes! That didn't turn out well. I will make a new top-level post. Sorry.

You need to login to post a comment.