/* * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * AndroidWorld Library, Copyright 2011 Bryan Chadwick * * * * FILE: ./android/image/ColorDatabase.java * * * * This file is part of AndroidWorld. * * * * AndroidWorld is free software: you can redistribute it and/or * * modify it under the terms of the GNU General Public License * * as published by the Free Software Foundation, either version * * 3 of the License, or (at your option) any later version. * * * * AndroidWorld is distributed in the hope that it will be useful, * * but WITHOUT ANY WARRANTY; without even the implied warranty of * * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the * * GNU General Public License for more details. * * * * You should have received a copy of the GNU General Public License * * along with AndroidWorld. If not, see . * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * */ package android.image; import java.util.HashMap; import android.graphics.Color; /** * * * Manages color names and translation to implementation-dependent Color structures. * *

* Available colors are listed in the following table. If an undefined color is used then a RuntimeException * is thrown. Custom colors can be created using the static {@link ColorDatabase#makeColor makeColor} methods. *

*

* Alternatively clients can specify a 7 character string beginning with a '#' (hash-mark) * followed by a 6 digit hexadecimal number that encodes the requested RGB color, e.g., * "#FF0000" for Red, or "#00FF00" for Green. * For advanced users, a 9 character string beginning with a '#' followed by an 8 digit * hexadecimal number that encodes the requested ARGB color (Alpha, Red, Green, Blue), e.g., * "#FFFF0000" for Opaque Red, or "#8800FF00" * for Half-Transparent Green. *

*

* Color names are case-insensitive. *

* *
* * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * *
"orange red"     
"orangered"     
"tomato"     
"darkred"     
"red"     
"firebrick"     
"crimson"     
"deeppink"     
"maroon"     
"indian red"     
"indianred"     
"medium violet red"     
"mediumvioletred"     
"violet red"     
"violetred"     
"lightcoral"     
"hotpink"     
"palevioletred"     
"lightpink"     
"rosybrown"     
"pink"     
"orchid"     
"lavenderblush"     
"snow"     
"chocolate"     
"saddlebrown"     
"brown"     
"darkorange"     
"coral"     
"sienna"     
"orange"     
"salmon"     
"peru"     
"darkgoldenrod"     
"goldenrod"     
"sandybrown"     
"lightsalmon"     
"darksalmon"     
"gold"     
"yellow"     
"olive"     
"burlywood"     
"tan"     
"navajowhite"     
"peachpuff"     
"khaki"     
"darkkhaki"     
"moccasin"     
"wheat"     
"bisque"     
"palegoldenrod"     
"blanchedalmond"     
"medium goldenrod"     
"mediumgoldenrod"     
"papayawhip"     
"mistyrose"     
"lemonchiffon"     
"antiquewhite"     
"cornsilk"     
"lightgoldenrodyellow"     
"oldlace"     
"linen"     
"lightyellow"     
"seashell"     
"beige"     
"floralwhite"     
"ivory"     
"green"     
"lawngreen"     
"chartreuse"     
"green yellow"     
"greenyellow"     
"yellow green"     
"yellowgreen"     
"medium forest green"     
"olivedrab"     
"mediumforestgreen"     
"dark olive green"     
"darkolivegreen"     
"darkseagreen"     
"lime"     
"dark green"     
"darkgreen"     
"lime green"     
"limegreen"     
"forest green"     
"forestgreen"     
"spring green"     
"springgreen"     
"medium spring green"     
"mediumspringgreen"     
"sea green"     
"seagreen"     
"medium sea green"     
"mediumseagreen"     
"aquamarine"     
"lightgreen"     
"pale green"     
"palegreen"     
"medium aquamarine"     
"mediumaquamarine"     
"turquoise"     
"lightseagreen"     
"medium turquoise"     
"mediumturquoise"     
"honeydew"     
"mintcream"     
"royalblue"     
"dodgerblue"     
"deepskyblue"     
"cornflowerblue"     
"steel blue"     
"steelblue"     
"lightskyblue"     
"dark turquoise"     
"darkturquoise"     
"cyan"     
"aqua"     
"darkcyan"     
"teal"     
"sky blue"     
"skyblue"     
"cadet blue"     
"cadetblue"     
"dark slate gray"     
"darkslategray"     
"lightslategray"     
"slategray"     
"dark slate grey"     
"darkslategrey"     
"lightslategrey"     
"slategrey"     
"light steel blue"     
"lightsteelblue"     
"light blue"     
"lightblue"     
"powderblue"     
"paleturquoise"     
"lightcyan"     
"aliceblue"     
"azure"     
"medium blue"     
"mediumblue"     
"darkblue"     
"midnight blue"     
"midnightblue"     
"navy"     
"blue"     
"indigo"     
"blue violet"     
"blueviolet"     
"medium slate blue"     
"mediumslateblue"     
"slate blue"     
"slateblue"     
"purple"     
"dark slate blue"     
"darkslateblue"     
"darkviolet"     
"dark orchid"     
"darkorchid"     
"mediumpurple"     
"cornflower blue"     
"medium orchid"     
"mediumorchid"     
"magenta"     
"fuchsia"     
"darkmagenta"     
"violet"     
"plum"     
"lavender"     
"thistle"     
"ghostwhite"     
"white"     
"whitesmoke"     
"gainsboro"     
"light gray"     
"lightgray"     
"light grey"     
"lightgrey"     
"silver"     
"gray"     
"dark gray"     
"darkgray"     
"dim gray"     
"dimgray"     
"dark grey"     
"darkgrey"     
"dim grey"     
"dimgrey"     
"black"     
*
* */ public class ColorDatabase { /** Get the java.awt.Color represented by the given string */ public static int color(String s){ s = s.toLowerCase(); if(s.startsWith("#") && (s.length() == 7 || s.length() == 9)) return parseColor(s.substring(1)); if(colorTable.containsKey(s)) return colorTable.get(s); return Color.BLACK; } /** The Hexidecimal Digits as a String (in order) */ private static String HEX_DIGITS = "0123456789ABCDEF"; /** Create a color String from the given Alpha/Red/Green/Blue intensities in [0..255]. */ public static String makeColor(int red, int green, int blue){ return makeColor(255, red, blue, green); } /** Create a color String from the given Alpha/Red/Green/Blue intensities in [0..255]. */ public static String makeColor(int alpha, int red, int green, int blue){ return "#"+HEX_DIGITS.charAt(alpha/16%16)+ HEX_DIGITS.charAt(alpha%16)+ HEX_DIGITS.charAt(red/16%16)+ HEX_DIGITS.charAt(red%16)+ HEX_DIGITS.charAt(green/16%16)+ HEX_DIGITS.charAt(green%16)+ HEX_DIGITS.charAt(blue/16%16)+ HEX_DIGITS.charAt(blue%16); } /** Create a color String from the given Red/Green/Blue fractional intensities in [0..1.0]. */ public static String makeColor(double red, double green, double blue){ return makeColor(1.0, red, green, blue); } /** Create a color String from the given Alpha/Red/Green/Blue fractional intensities in [0..1.0]. */ public static String makeColor(double alpha, double red, double green, double blue){ return makeColor((int)(alpha*255), (int)(red*255), (int)(green*255), (int)(blue*255)); } /** Convert the given Color String into ARGB integer format. */ public static int colorToARGB(String c){ return color(c); } /** Convert the given Color intensities into ARGB integer format. * RGB intensities must be between 0 and 1.0, inclusive.*/ public static int colorToARGB(double red, double green, double blue){ return colorToARGB(1.0, red, green, blue); } /** Convert the given Alpha and Color intensities into ARGB integer * format. ARGB intensities must be between 0 and 1.0, inclusive.*/ public static int colorToARGB(double alpha, double red, double green, double blue){ return colorToARGB((int)(alpha*255), (int)(red*255), (int)(green*255), (int)(blue*255)); } /** Convert the given Color intensities into ARGB integer format. * RGB intensities must be between 0 and 255, inclusive. */ public static int colorToARGB(int red, int green, int blue){ return colorToARGB(255, red, green, blue); } private static int ALPHA_SHIFT = 24; private static int RED_SHIFT = 16; private static int GREEN_SHIFT = 8; private static int BLUE_SHIFT = 0; /** Convert the given Alpha and Color intensities into ARGB integer * format. ARGB intensities must be between 0 and 255, inclusive.*/ public static int colorToARGB(int alpha, int red, int green, int blue){ alpha = Math.min(alpha, 255); red = Math.min(red, 255); green = Math.min(green, 255); blue = Math.min(blue, 255); return (alpha<>ALPHA_SHIFT)&0xFF, (color>>RED_SHIFT)&0xFF, (color>>GREEN_SHIFT)&0xFF, (color>>BLUE_SHIFT)&0xFF); } /** Get the Alpha component of an integer Color in the ARGB format. */ public static int argbAlpha(int color){ return (color>>ALPHA_SHIFT)&0xFF; } /** Get the Red component of an integer Color in the ARGB format. */ public static int argbRed(int color){ return (color>>RED_SHIFT)&0xFF; } /** Get the Green component of an integer Color in the ARGB format. */ public static int argbGreen(int color){ return (color>>GREEN_SHIFT)&0xFF; } /** Get the Blue component of an integer Color in the ARGB format. */ public static int argbBlue(int color){ return (color>>BLUE_SHIFT)&0xFF; } /** Parse a hex-Color from a 6 digit String (two each for Red, Green, Blue */ public static int parseColor(String c){ String one = c.substring(0,2); String two = c.substring(2,4); String thr = c.substring(4,6); if(c.length() == 6){ return Color.rgb(Integer.parseInt(one, 16), Integer.parseInt(two, 16), Integer.parseInt(thr, 16)); }else{ return Color.argb(Integer.parseInt(one, 16), Integer.parseInt(two, 16), Integer.parseInt(thr, 16), Integer.parseInt(c.substring(6,8), 16)); } } /** Available colors... */ private static HashMap colorTable = new HashMap(); static{ colorTable.put("orangered", Color.rgb(0xff, 0x45, 0x00)); colorTable.put("tomato", Color.rgb(0xff, 0x63, 0x47)); colorTable.put("darkred", Color.rgb(0x8b, 0x00, 0x00)); colorTable.put("red", Color.rgb(0xff, 0x00, 0x00)); colorTable.put("firebrick", Color.rgb(0xb2, 0x22, 0x22)); colorTable.put("crimson", Color.rgb(0xdc, 0x14, 0x3c)); colorTable.put("deeppink", Color.rgb(0xff, 0x14, 0x93)); colorTable.put("maroon", Color.rgb(0xb0, 0x30, 0x60)); colorTable.put("indian red", Color.rgb(0xcd, 0x5c, 0x5c)); colorTable.put("indianred", Color.rgb(0xcd, 0x5c, 0x5c)); colorTable.put("medium violet red", Color.rgb(0xc7, 0x15, 0x85)); colorTable.put("mediumvioletred", Color.rgb(0xc7, 0x15, 0x85)); colorTable.put("violet red", Color.rgb(0xd0, 0x20, 0x90)); colorTable.put("violetred", Color.rgb(0xd0, 0x20, 0x90)); colorTable.put("lightcoral", Color.rgb(0xf0, 0x80, 0x80)); colorTable.put("hotpink", Color.rgb(0xff, 0x69, 0xb4)); colorTable.put("palevioletred", Color.rgb(0xdb, 0x70, 0x93)); colorTable.put("lightpink", Color.rgb(0xff, 0xb6, 0xc1)); colorTable.put("rosybrown", Color.rgb(0xbc, 0x8f, 0x8f)); colorTable.put("pink", Color.rgb(0xff, 0xc0, 0xcb)); colorTable.put("orchid", Color.rgb(0xda, 0x70, 0xd6)); colorTable.put("lavenderblush", Color.rgb(0xff, 0xf0, 0xf5)); colorTable.put("snow", Color.rgb(0xff, 0xfa, 0xfa)); colorTable.put("chocolate", Color.rgb(0xd2, 0x69, 0x1e)); colorTable.put("saddlebrown", Color.rgb(0x8b, 0x45, 0x13)); colorTable.put("brown", Color.rgb(0x84, 0x3c, 0x24)); colorTable.put("darkorange", Color.rgb(0xff, 0x8c, 0x00)); colorTable.put("coral", Color.rgb(0xff, 0x7f, 0x50)); colorTable.put("sienna", Color.rgb(0xa0, 0x52, 0x2d)); colorTable.put("orange", Color.rgb(0xff, 0xa5, 0x00)); colorTable.put("salmon", Color.rgb(0xfa, 0x80, 0x72)); colorTable.put("peru", Color.rgb(0xcd, 0x85, 0x3f)); colorTable.put("darkgoldenrod", Color.rgb(0xb8, 0x86, 0x0b)); colorTable.put("goldenrod", Color.rgb(0xda, 0xa5, 0x20)); colorTable.put("sandybrown", Color.rgb(0xf4, 0xa4, 0x60)); colorTable.put("lightsalmon", Color.rgb(0xff, 0xa0, 0x7a)); colorTable.put("darksalmon", Color.rgb(0xe9, 0x96, 0x7a)); colorTable.put("gold", Color.rgb(0xff, 0xd7, 0x00)); colorTable.put("yellow", Color.rgb(0xff, 0xff, 0x00)); colorTable.put("olive", Color.rgb(0x80, 0x80, 0x00)); colorTable.put("burlywood", Color.rgb(0xde, 0xb8, 0x87)); colorTable.put("tan", Color.rgb(0xd2, 0xb4, 0x8c)); colorTable.put("navajowhite", Color.rgb(0xff, 0xde, 0xad)); colorTable.put("peachpuff", Color.rgb(0xff, 0xda, 0xb9)); colorTable.put("khaki", Color.rgb(0xf0, 0xe6, 0x8c)); colorTable.put("darkkhaki", Color.rgb(0xbd, 0xb7, 0x6b)); colorTable.put("moccasin", Color.rgb(0xff, 0xe4, 0xb5)); colorTable.put("wheat", Color.rgb(0xf5, 0xde, 0xb3)); colorTable.put("bisque", Color.rgb(0xff, 0xe4, 0xc4)); colorTable.put("palegoldenrod", Color.rgb(0xee, 0xe8, 0xaa)); colorTable.put("blanchedalmond", Color.rgb(0xff, 0xeb, 0xcd)); colorTable.put("medium goldenrod", Color.rgb(0xea, 0xea, 0xad)); colorTable.put("mediumgoldenrod", Color.rgb(0xea, 0xea, 0xad)); colorTable.put("papayawhip", Color.rgb(0xff, 0xef, 0xd5)); colorTable.put("mistyrose", Color.rgb(0xff, 0xe4, 0xe1)); colorTable.put("lemonchiffon", Color.rgb(0xff, 0xfa, 0xcd)); colorTable.put("antiquewhite", Color.rgb(0xfa, 0xeb, 0xd7)); colorTable.put("cornsilk", Color.rgb(0xff, 0xf8, 0xdc)); colorTable.put("lightgoldenrodyellow", Color.rgb(0xfa, 0xfa, 0xd2)); colorTable.put("oldlace", Color.rgb(0xfd, 0xf5, 0xe6)); colorTable.put("linen", Color.rgb(0xfa, 0xf0, 0xe6)); colorTable.put("lightyellow", Color.rgb(0xff, 0xff, 0xe0)); colorTable.put("seashell", Color.rgb(0xff, 0xf5, 0xee)); colorTable.put("beige", Color.rgb(0xf5, 0xf5, 0xdc)); colorTable.put("floralwhite", Color.rgb(0xff, 0xfa, 0xf0)); colorTable.put("ivory", Color.rgb(0xff, 0xff, 0xf0)); colorTable.put("green", Color.rgb(0x00, 0xff, 0x00)); colorTable.put("lawngreen", Color.rgb(0x7c, 0xfc, 0x00)); colorTable.put("chartreuse", Color.rgb(0x7f, 0xff, 0x00)); colorTable.put("green yellow", Color.rgb(0xad, 0xff, 0x2f)); colorTable.put("greenyellow", Color.rgb(0xad, 0xff, 0x2f)); colorTable.put("yellow green", Color.rgb(0x9a, 0xcd, 0x32)); colorTable.put("yellowgreen", Color.rgb(0x9a, 0xcd, 0x32)); colorTable.put("medium forest green", Color.rgb(0x6b, 0x8e, 0x23)); colorTable.put("olivedrab", Color.rgb(0x6b, 0x8e, 0x23)); colorTable.put("mediumforestgreen", Color.rgb(0x6b, 0x8e, 0x23)); colorTable.put("dark olive green", Color.rgb(0x55, 0x6b, 0x2f)); colorTable.put("darkolivegreen", Color.rgb(0x55, 0x6b, 0x2f)); colorTable.put("darkseagreen", Color.rgb(0x8f, 0xbc, 0x8b)); colorTable.put("lime", Color.rgb(0x00, 0xff, 0x00)); colorTable.put("dark green", Color.rgb(0x00, 0x64, 0x00)); colorTable.put("darkgreen", Color.rgb(0x00, 0x64, 0x00)); colorTable.put("lime green", Color.rgb(0x32, 0xcd, 0x32)); colorTable.put("limegreen", Color.rgb(0x32, 0xcd, 0x32)); colorTable.put("forest green", Color.rgb(0x22, 0x8b, 0x22)); colorTable.put("forestgreen", Color.rgb(0x22, 0x8b, 0x22)); colorTable.put("spring green", Color.rgb(0x00, 0xff, 0x7f)); colorTable.put("springgreen", Color.rgb(0x00, 0xff, 0x7f)); colorTable.put("medium spring green", Color.rgb(0x00, 0xfa, 0x9a)); colorTable.put("mediumspringgreen", Color.rgb(0x00, 0xfa, 0x9a)); colorTable.put("sea green", Color.rgb(0x2e, 0x8b, 0x57)); colorTable.put("seagreen", Color.rgb(0x2e, 0x8b, 0x57)); colorTable.put("medium sea green", Color.rgb(0x3c, 0xb3, 0x71)); colorTable.put("mediumseagreen", Color.rgb(0x3c, 0xb3, 0x71)); colorTable.put("aquamarine", Color.rgb(0x70, 0xd8, 0x90)); colorTable.put("lightgreen", Color.rgb(0x90, 0xee, 0x90)); colorTable.put("pale green", Color.rgb(0x98, 0xfb, 0x98)); colorTable.put("palegreen", Color.rgb(0x98, 0xfb, 0x98)); colorTable.put("medium aquamarine", Color.rgb(0x66, 0xcd, 0xaa)); colorTable.put("mediumaquamarine", Color.rgb(0x66, 0xcd, 0xaa)); colorTable.put("turquoise", Color.rgb(0x40, 0xe0, 0xd0)); colorTable.put("lightseagreen", Color.rgb(0x20, 0xb2, 0xaa)); colorTable.put("medium turquoise", Color.rgb(0x48, 0xd1, 0xcc)); colorTable.put("mediumturquoise", Color.rgb(0x48, 0xd1, 0xcc)); colorTable.put("honeydew", Color.rgb(0xf0, 0xff, 0xf0)); colorTable.put("mintcream", Color.rgb(0xf5, 0xff, 0xfa)); colorTable.put("royalblue", Color.rgb(0x41, 0x69, 0xe1)); colorTable.put("dodgerblue", Color.rgb(0x1e, 0x90, 0xff)); colorTable.put("deepskyblue", Color.rgb(0x00, 0xbf, 0xff)); colorTable.put("cornflowerblue", Color.rgb(0x64, 0x95, 0xed)); colorTable.put("steel blue", Color.rgb(0x46, 0x82, 0xb4)); colorTable.put("steelblue", Color.rgb(0x46, 0x82, 0xb4)); colorTable.put("lightskyblue", Color.rgb(0x87, 0xce, 0xfa)); colorTable.put("dark turquoise", Color.rgb(0x00, 0xce, 0xd1)); colorTable.put("darkturquoise", Color.rgb(0x00, 0xce, 0xd1)); colorTable.put("cyan", Color.rgb(0x00, 0xff, 0xff)); colorTable.put("aqua", Color.rgb(0x00, 0xff, 0xff)); colorTable.put("darkcyan", Color.rgb(0x00, 0x8b, 0x8b)); colorTable.put("teal", Color.rgb(0x00, 0x80, 0x80)); colorTable.put("sky blue", Color.rgb(0x87, 0xce, 0xeb)); colorTable.put("skyblue", Color.rgb(0x87, 0xce, 0xeb)); colorTable.put("cadet blue", Color.rgb(0x60, 0xa0, 0xa0)); colorTable.put("cadetblue", Color.rgb(0x5f, 0x9e, 0xa0)); colorTable.put("dark slate gray", Color.rgb(0x2f, 0x4f, 0x4f)); colorTable.put("darkslategray", Color.rgb(0x2f, 0x4f, 0x4f)); colorTable.put("lightslategray", Color.rgb(0x77, 0x88, 0x99)); colorTable.put("slategray", Color.rgb(0x70, 0x80, 0x90)); colorTable.put("dark slate grey", Color.rgb(0x2f, 0x4f, 0x4f)); colorTable.put("darkslategrey", Color.rgb(0x2f, 0x4f, 0x4f)); colorTable.put("lightslategrey", Color.rgb(0x77, 0x88, 0x99)); colorTable.put("slategrey", Color.rgb(0x70, 0x80, 0x90)); colorTable.put("light steel blue", Color.rgb(0xb0, 0xc4, 0xde)); colorTable.put("lightsteelblue", Color.rgb(0xb0, 0xc4, 0xde)); colorTable.put("light blue", Color.rgb(0xad, 0xd8, 0xe6)); colorTable.put("lightblue", Color.rgb(0xad, 0xd8, 0xe6)); colorTable.put("powderblue", Color.rgb(0xb0, 0xe0, 0xe6)); colorTable.put("paleturquoise", Color.rgb(0xaf, 0xee, 0xee)); colorTable.put("lightcyan", Color.rgb(0xe0, 0xff, 0xff)); colorTable.put("aliceblue", Color.rgb(0xf0, 0xf8, 0xff)); colorTable.put("azure", Color.rgb(0xf0, 0xff, 0xff)); colorTable.put("medium blue", Color.rgb(0x00, 0x00, 0xcd)); colorTable.put("mediumblue", Color.rgb(0x00, 0x00, 0xcd)); colorTable.put("darkblue", Color.rgb(0x00, 0x00, 0x8b)); colorTable.put("midnight blue", Color.rgb(0x19, 0x19, 0x70)); colorTable.put("midnightblue", Color.rgb(0x19, 0x19, 0x70)); colorTable.put("navy", Color.rgb(0x24, 0x24, 0x8c)); colorTable.put("blue", Color.rgb(0x00, 0x00, 0xff)); colorTable.put("indigo", Color.rgb(0x4b, 0x00, 0x82)); colorTable.put("blue violet", Color.rgb(0x8a, 0x2b, 0xe2)); colorTable.put("blueviolet", Color.rgb(0x8a, 0x2b, 0xe2)); colorTable.put("medium slate blue", Color.rgb(0x7b, 0x68, 0xee)); colorTable.put("mediumslateblue", Color.rgb(0x7b, 0x68, 0xee)); colorTable.put("slate blue", Color.rgb(0x6a, 0x5a, 0xcd)); colorTable.put("slateblue", Color.rgb(0x6a, 0x5a, 0xcd)); colorTable.put("purple", Color.rgb(0xa0, 0x20, 0xf0)); colorTable.put("dark slate blue", Color.rgb(0x48, 0x3d, 0x8b)); colorTable.put("darkslateblue", Color.rgb(0x48, 0x3d, 0x8b)); colorTable.put("darkviolet", Color.rgb(0x94, 0x00, 0xd3)); colorTable.put("dark orchid", Color.rgb(0x99, 0x32, 0xcc)); colorTable.put("darkorchid", Color.rgb(0x99, 0x32, 0xcc)); colorTable.put("mediumpurple", Color.rgb(0x93, 0x70, 0xdb)); colorTable.put("cornflower blue", Color.rgb(0x44, 0x40, 0x6c)); colorTable.put("medium orchid", Color.rgb(0xba, 0x55, 0xd3)); colorTable.put("mediumorchid", Color.rgb(0xba, 0x55, 0xd3)); colorTable.put("magenta", Color.rgb(0xff, 0x00, 0xff)); colorTable.put("fuchsia", Color.rgb(0xff, 0x00, 0xff)); colorTable.put("darkmagenta", Color.rgb(0x8b, 0x00, 0x8b)); colorTable.put("violet", Color.rgb(0xee, 0x82, 0xee)); colorTable.put("plum", Color.rgb(0xdd, 0xa0, 0xdd)); colorTable.put("lavender", Color.rgb(0xe6, 0xe6, 0xfa)); colorTable.put("thistle", Color.rgb(0xd8, 0xbf, 0xd8)); colorTable.put("ghostwhite", Color.rgb(0xf8, 0xf8, 0xff)); colorTable.put("white", Color.rgb(0xff, 0xff, 0xff)); colorTable.put("whitesmoke", Color.rgb(0xf5, 0xf5, 0xf5)); colorTable.put("gainsboro", Color.rgb(0xdc, 0xdc, 0xdc)); colorTable.put("light gray", Color.rgb(0xd3, 0xd3, 0xd3)); colorTable.put("lightgray", Color.rgb(0xd3, 0xd3, 0xd3)); colorTable.put("light grey", Color.rgb(0xd3, 0xd3, 0xd3)); colorTable.put("lightgrey", Color.rgb(0xd3, 0xd3, 0xd3)); colorTable.put("silver", Color.rgb(0xc0, 0xc0, 0xc0)); colorTable.put("gray", Color.rgb(0xbe, 0xbe, 0xbe)); colorTable.put("dark gray", Color.rgb(0xa9, 0xa9, 0xa9)); colorTable.put("darkgray", Color.rgb(0xa9, 0xa9, 0xa9)); colorTable.put("dim gray", Color.rgb(0x69, 0x69, 0x69)); colorTable.put("dimgray", Color.rgb(0x69, 0x69, 0x69)); colorTable.put("dark grey", Color.rgb(0xa9, 0xa9, 0xa9)); colorTable.put("darkgrey", Color.rgb(0xa9, 0xa9, 0xa9)); colorTable.put("dim grey", Color.rgb(0x69, 0x69, 0x69)); colorTable.put("dimgrey", Color.rgb(0x69, 0x69, 0x69)); colorTable.put("black", Color.rgb(0x00, 0x00, 0x00)); } }