/*
 * Copyright 2005 Salem Ganzhorn <eyekode@yahoo.com>
 *
 * This file is a stoopidsimple creation.
 *
 * This is free software; you can redistribute it and/or modify
 * it under the terms of version 2 of the GNU General Public License
 * as published by the Free Software Foundation.
 *
 * This file 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.
 *
 * For your copy of the GNU General Public License write to the 
 * Free Software Foundation, Inc., 51 Franklin St, Fifth Floor, 
 * Boston, MA  02110-1301  USA
 *
 */

/*
 * Created on Mar 25, 2005
 *
 * TODO To change the template for this generated file go to
 * Window - Preferences - Java - Code Style - Code Templates
 */
package gradient;
import java.awt.*;
import java.util.*;

import sun.misc.Sort;

/**
 * @author ganzhorn
 *
 * TODO To change the template for this generated type comment go to
 * Window - Preferences - Java - Code Style - Code Templates
 */
public class HTMLColors {
    static HashMap m_c2s;
    static HashMap m_s2c;
    static String  m_names[];
    static Color nameToColor( String name ) {
        return (Color)m_s2c.get(name);
    }
    static String colorToName( Color c ) {
        return (String)m_c2s.get(c);
    }
    static String[] names() {
       return m_names;
    }
    static Set colors() {
        return m_c2s.keySet();
    }
    static {
        m_s2c = new HashMap();
        m_s2c.put(new String("AliceBlue"),new Color(240,248,255));
        m_s2c.put(new String("AntiqueWhite"),new Color(250,235,215));
        m_s2c.put(new String("Aqua"),new Color(0,255,255));
        m_s2c.put(new String("Aquamarine"),new Color(127,255,212));
        m_s2c.put(new String("Azure"),new Color(240,255,255));
        m_s2c.put(new String("Beige"),new Color(245,245,220));
        m_s2c.put(new String("Bisque"),new Color(255,228,196));
        m_s2c.put(new String("Black"),new Color(0,0,0));
        m_s2c.put(new String("BlanchedAlmond"),new Color(255,235,205));
        m_s2c.put(new String("Blue"),new Color(0,0,255));
        m_s2c.put(new String("BlueViolet"),new Color(138,43,226));
        m_s2c.put(new String("Brown"),new Color(165,42,42));
        m_s2c.put(new String("BurlyWood"),new Color(222,184,135));
        m_s2c.put(new String("CadetBlue"),new Color(95,158,160));
        m_s2c.put(new String("Chartreuse"),new Color(127,255,0));
        m_s2c.put(new String("Chocolate"),new Color(210,105,30));
        m_s2c.put(new String("Coral"),new Color(255,127,80));
        m_s2c.put(new String("CornflowerBlue"),new Color(100,149,237));
        m_s2c.put(new String("Cornsilk"),new Color(255,248,220));
        m_s2c.put(new String("Crimson"),new Color(220,20,60));
        m_s2c.put(new String("Cyan"),new Color(0,255,255));
        m_s2c.put(new String("DarkBlue"),new Color(0,0,139));
        m_s2c.put(new String("DarkCyan"),new Color(0,139,139));
        m_s2c.put(new String("DarkGoldenRod"),new Color(184,134,11));
        m_s2c.put(new String("DarkGray"),new Color(169,169,169));
        m_s2c.put(new String("DarkGreen"),new Color(0,100,0));
        m_s2c.put(new String("DarkKhaki"),new Color(189,183,107));
        m_s2c.put(new String("DarkMagenta"),new Color(139,0,139));
        m_s2c.put(new String("DarkOliveGreen"),new Color(85,107,47));
        m_s2c.put(new String("DarkOrchid"),new Color(153,50,204));
        m_s2c.put(new String("DarkRed"),new Color(139,0,0));
        m_s2c.put(new String("DarkSalmon"),new Color(233,150,122));
        m_s2c.put(new String("DarkSeaGreen"),new Color(143,188,143));
        m_s2c.put(new String("DarkSlateBlue"),new Color(72,61,139));
        m_s2c.put(new String("DarkSlateGray"),new Color(47,79,79));
        m_s2c.put(new String("DarkTurquoise"),new Color(0,206,209));
        m_s2c.put(new String("DarkViolet"),new Color(148,0,211));
        m_s2c.put(new String("DarkOrange"),new Color(255,140,0));
        m_s2c.put(new String("DeepPink"),new Color(255,20,147));
        m_s2c.put(new String("DeepSkyBlue"),new Color(0,191,255));
        m_s2c.put(new String("DimGray"),new Color(105,105,105));
        m_s2c.put(new String("DodgerBlue"),new Color(30,144,255));
        m_s2c.put(new String("Feldspar"),new Color(209,146,117));
        m_s2c.put(new String("FireBrick"),new Color(178,34,34));
        m_s2c.put(new String("FloralWhite"),new Color(255,250,240));
        m_s2c.put(new String("ForestGreen"),new Color(34,139,34));
        m_s2c.put(new String("Fuchsia"),new Color(255,0,255));
        m_s2c.put(new String("Gainsboro"),new Color(220,220,220));
        m_s2c.put(new String("GhostWhite"),new Color(248,248,255));
        m_s2c.put(new String("Gold"),new Color(255,215,0));
        m_s2c.put(new String("GoldenRod"),new Color(218,165,32));
        m_s2c.put(new String("Gray"),new Color(128,128,128));
        m_s2c.put(new String("Green"),new Color(0,128,0));
        m_s2c.put(new String("GreenYellow"),new Color(173,255,47));
        m_s2c.put(new String("HoneyDew"),new Color(240,255,240));
        m_s2c.put(new String("HotPink"),new Color(255,105,180));
        m_s2c.put(new String("IndianRed"),new Color(205,92,92));
        m_s2c.put(new String("Indigo"),new Color(75,0,130));
        m_s2c.put(new String("Ivory"),new Color(255,255,240));
        m_s2c.put(new String("Khaki"),new Color(240,230,140));
        m_s2c.put(new String("Lavender"),new Color(230,230,250));
        m_s2c.put(new String("LavenderBlush"),new Color(255,240,245));
        m_s2c.put(new String("LawnGreen"),new Color(124,252,0));
        m_s2c.put(new String("LemonChiffon"),new Color(255,250,205));
        m_s2c.put(new String("LightBlue"),new Color(173,216,230));
        m_s2c.put(new String("LightCoral"),new Color(240,128,128));
        m_s2c.put(new String("LightCyan"),new Color(224,255,255));
        m_s2c.put(new String("LightGoldenRodYellow"),new Color(250,250,210));
        m_s2c.put(new String("LightGreen"),new Color(144,238,144));
        m_s2c.put(new String("LightGrey"),new Color(211,211,211));
        m_s2c.put(new String("LightPink"),new Color(255,182,193));
        m_s2c.put(new String("LightSalmon"),new Color(255,160,122));
        m_s2c.put(new String("LightSeaGreen"),new Color(32,178,170));
        m_s2c.put(new String("LightSkyBlue"),new Color(135,206,250));
        m_s2c.put(new String("LightSlateBlue"),new Color(132,112,255));
        m_s2c.put(new String("LightSlateGray"),new Color(119,136,153));
        m_s2c.put(new String("LightSteelBlue"),new Color(176,196,222));
        m_s2c.put(new String("LightYellow"),new Color(255,255,224));
        m_s2c.put(new String("Lime"),new Color(0,255,0));
        m_s2c.put(new String("LimeGreen"),new Color(50,205,50));
        m_s2c.put(new String("Linen"),new Color(250,240,230));
        m_s2c.put(new String("Magenta"),new Color(255,0,255));
        m_s2c.put(new String("Maroon"),new Color(128,0,0));
        m_s2c.put(new String("MediumAquaMarine"),new Color(102,205,170));
        m_s2c.put(new String("MediumBlue"),new Color(0,0,205));
        m_s2c.put(new String("MediumOrchid"),new Color(186,85,211));
        m_s2c.put(new String("MediumPurple"),new Color(147,112,216));
        m_s2c.put(new String("MediumSeaGreen"),new Color(60,179,113));
        m_s2c.put(new String("MediumSlateBlue"),new Color(123,104,238));
        m_s2c.put(new String("MediumSpringGreen"),new Color(0,250,154));
        m_s2c.put(new String("MediumTurquoise"),new Color(72,209,204));
        m_s2c.put(new String("MediumVioletRed"),new Color(199,21,133));
        m_s2c.put(new String("MidnightBlue"),new Color(25,25,112));
        m_s2c.put(new String("MintCream"),new Color(245,255,250));
        m_s2c.put(new String("MistyRose"),new Color(255,228,225));
        m_s2c.put(new String("Moccasin"),new Color(255,228,181));
        m_s2c.put(new String("NavajoWhite"),new Color(255,222,173));
        m_s2c.put(new String("Navy"),new Color(0,0,128));
        m_s2c.put(new String("OldLace"),new Color(253,245,230));
        m_s2c.put(new String("Olive"),new Color(128,128,0));
        m_s2c.put(new String("OliveDrab"),new Color(107,142,35));
        m_s2c.put(new String("Orange"),new Color(255,165,0));
        m_s2c.put(new String("OrangeRed"),new Color(255,69,0));
        m_s2c.put(new String("Orchid"),new Color(218,112,214));
        m_s2c.put(new String("PaleGoldenRod"),new Color(238,232,170));
        m_s2c.put(new String("PaleGreen"),new Color(152,251,152));
        m_s2c.put(new String("PaleTurquoise"),new Color(175,238,238));
        m_s2c.put(new String("PaleVioletRed"),new Color(216,112,147));
        m_s2c.put(new String("PapayaWhip"),new Color(255,239,213));
        m_s2c.put(new String("PeachPuff"),new Color(255,218,185));
        m_s2c.put(new String("Peru"),new Color(205,133,63));
        m_s2c.put(new String("Pink"),new Color(255,192,203));
        m_s2c.put(new String("Plum"),new Color(221,160,221));
        m_s2c.put(new String("PowderBlue"),new Color(176,224,230));
        m_s2c.put(new String("Purple"),new Color(128,0,128));
        m_s2c.put(new String("Red"),new Color(255,0,0));
        m_s2c.put(new String("RosyBrown"),new Color(188,143,143));
        m_s2c.put(new String("RoyalBlue"),new Color(65,105,225));
        m_s2c.put(new String("SaddleBrown"),new Color(139,69,19));
        m_s2c.put(new String("Salmon"),new Color(250,128,114));
        m_s2c.put(new String("SandyBrown"),new Color(244,164,96));
        m_s2c.put(new String("SeaGreen"),new Color(46,139,87));
        m_s2c.put(new String("SeaShell"),new Color(255,245,238));
        m_s2c.put(new String("Sienna"),new Color(160,82,45));
        m_s2c.put(new String("Silver"),new Color(192,192,192));
        m_s2c.put(new String("SkyBlue"),new Color(135,206,235));
        m_s2c.put(new String("SlateBlue"),new Color(106,90,205));
        m_s2c.put(new String("SlateGray"),new Color(112,128,144));
        m_s2c.put(new String("Snow"),new Color(255,250,250));
        m_s2c.put(new String("SpringGreen"),new Color(0,255,127));
        m_s2c.put(new String("SteelBlue"),new Color(70,130,180));
        m_s2c.put(new String("Tan"),new Color(210,180,140));
        m_s2c.put(new String("Teal"),new Color(0,128,128));
        m_s2c.put(new String("Thistle"),new Color(216,191,216));
        m_s2c.put(new String("Tomato"),new Color(255,99,71));
        m_s2c.put(new String("Turquoise"),new Color(64,224,208));
        m_s2c.put(new String("Violet"),new Color(238,130,238));
        m_s2c.put(new String("VioletRed"),new Color(208,32,144));
        m_s2c.put(new String("Wheat"),new Color(245,222,179));
        m_s2c.put(new String("White"),new Color(255,255,255));
        m_s2c.put(new String("WhiteSmoke"),new Color(245,245,245));
        m_s2c.put(new String("Yellow"),new Color(255,255,0));
        m_s2c.put(new String("YellowGreen"),new Color(154,205,50));

        m_c2s = new HashMap(m_s2c.size());
        Set names = m_s2c.keySet();
        Iterator i = names.iterator();
        
        m_names = new String[m_s2c.size()];
        int j = 0;
       	while(i.hasNext()) {
       	    String name = (String)i.next();
       	    m_c2s.put(m_s2c.get(name),name);
       	    m_names[j++] = name;
       	}     
       	Arrays.sort(m_names);
    }
}
