140 colors - defined for X Window System listed in O'Reilly html pocket reference 87pp : Color « 2D Graphics GUI « Java

Home
Java
1.2D Graphics GUI
2.2D Graphics GUI1
3.3D
4.Advanced Graphics
5.Ant
6.Apache Common
7.Chart
8.Class
9.Collections Data Structure
10.Data Type
11.Database SQL JDBC
12.Design Pattern
13.Development Class
14.EJB3
15.Email
16.Event
17.File Input Output
18.Game
19.Generics
20.GWT
21.Hibernate
22.I18N
23.J2EE
24.J2ME
25.JDK 6
26.JNDI LDAP
27.JPA
28.JSP
29.JSTL
30.Language Basics
31.Network Protocol
32.PDF RTF
33.Reflection
34.Regular Expressions
35.Scripting
36.Security
37.Servlets
38.Spring
39.Swing Components
40.Swing JFC
41.SWT JFace Eclipse
42.Threads
43.Tiny Application
44.Velocity
45.Web Services SOA
46.XML
Java Tutorial
Java Source Code / Java Documentation
Java Open Source
Jar File Download
Java Articles
Java Products
Java by API
SCJP
Java » 2D Graphics GUI » ColorScreenshots 
140 colors - defined for X Window System listed in O'Reilly html pocket reference 87pp
     
/*
** Caramel - Non-GUI Java Addons
** Copyright (c) 2001, 2002, 2003 by Gerald Bauer
**
** This program is free software.
**
** You may redistribute it and/or modify it under the terms of the GNU
** Lesser General Public License as published by the Free Software Foundation.
** Version 2.1 of the license should be included with this distribution in
** the file LICENSE, as well as License.html. If the license is not
** included with this distribution, you may find a copy at the FSF web
** site at 'www.gnu.org' or 'www.fsf.org', or you may write to the
** Free Software Foundation, 675 Mass Ave, Cambridge, MA 02139 USA.
**
** THIS SOFTWARE IS PROVIDED AS-IS WITHOUT WARRANTY OF ANY KIND,
** NOT EVEN THE IMPLIED WARRANTY OF MERCHANTABILITY. THE AUTHOR
** OF THIS SOFTWARE, ASSUMES _NO_ RESPONSIBILITY FOR ANY
** CONSEQUENCE RESULTING FROM THE USE, MODIFICATION, OR
** REDISTRIBUTION OF THIS SOFTWARE.
**
*/


import java.awt.*;
import java.util.*;

/**
 *  140 colors - defined for X Window System listed in O'Reilly html pocket
 *  reference 87pp
 */

public class ColorUtils
{

   public final static Color aliceblue = new Color240248255 );
   public final static Color antiquewhite = new Color250235215 );
   public final static Color aqua = new Color0255255 );
   public final static Color aquamarine = new Color127255212 );
   public final static Color azure = new Color240255255 );
   public final static Color beige = new Color245245220 );
   public final static Color bisque = new Color255228196 );
   public final static Color black = new Color00);
   public final static Color blanchedalmond = new Color255255205 );
   public final static Color blue = new Color00255 );
   public final static Color blueviolet = new Color13843226 );
   public final static Color brown = new Color1654242 );
   public final static Color burlywood = new Color222184135 );
   public final static Color cadetblue = new Color95158160 );
   public final static Color chartreuse = new Color127255);
   public final static Color chocolate = new Color21010530 );
   public final static Color coral = new Color25512780 );
   public final static Color cornflowerblue = new Color100149237 );
   public final static Color cornsilk = new Color255248220 );
   public final static Color crimson = new Color2202060 );
   public final static Color cyan = new Color0255255 );
   public final static Color darkblue = new Color00139 );
   public final static Color darkcyan = new Color0139139 );
   public final static Color darkgoldenrod = new Color18413411 );
   public final static Color darkgray = new Color169169169 );
   public final static Color darkgreen = new Color0100);
   public final static Color darkkhaki = new Color189183107 );
   public final static Color darkmagenta = new Color1390139 );
   public final static Color darkolivegreen = new Color8510747 );
   public final static Color darkorange = new Color255140);
   public final static Color darkorchid = new Color15350204 );
   public final static Color darkred = new Color1390);
   public final static Color darksalmon = new Color233150122 );
   public final static Color darkseagreen = new Color143188143 );
   public final static Color darkslateblue = new Color7261139 );
   public final static Color darkslategray = new Color477979 );
   public final static Color darkturquoise = new Color0206209 );
   public final static Color darkviolet = new Color1480211 );
   public final static Color deeppink = new Color25520147 );
   public final static Color deepskyblue = new Color0191255 );
   public final static Color dimgray = new Color105105105 );
   public final static Color dodgerblue = new Color30144255 );
   public final static Color firebrick = new Color1783434 );
   public final static Color floralwhite = new Color255250240 );
   public final static Color forestgreen = new Color3413934 );
   public final static Color fuchsia = new Color2550255 );
   public final static Color gainsboro = new Color220220220 );
   public final static Color ghostwhite = new Color248248255 );
   public final static Color gold = new Color255215);
   public final static Color goldenrod = new Color21816532 );
   public final static Color gray = new Color128128128 );
   public final static Color green = new Color0128);
   public final static Color greenyellow = new Color17325547 );
   public final static Color honeydew = new Color240255240 );
   public final static Color hotpink = new Color255105180 );
   public final static Color indianred = new Color2059292 );
   public final static Color indigo = new Color750130 );
   public final static Color ivory = new Color255240240 );
   public final static Color khaki = new Color240230140 );
   public final static Color lavender = new Color230230250 );
   public final static Color lavenderblush = new Color255240245 );
   public final static Color lawngreen = new Color124252);
   public final static Color lemonchiffon = new Color255250205 );
   public final static Color lightblue = new Color173216230 );
   public final static Color lightcoral = new Color240128128 );
   public final static Color lightcyan = new Color224255255 );
   public final static Color lightgoldenrodyellow = new Color250250210 );
   public final static Color lightgreen = new Color144238144 );
   public final static Color lightgrey = new Color211211211 );
   public final static Color lightpink = new Color255182193 );
   public final static Color lightsalmon = new Color255160122 );
   public final static Color lightseagreen = new Color32178170 );
   public final static Color lightskyblue = new Color135206250 );
   public final static Color lightslategray = new Color119136153 );
   public final static Color lightsteelblue = new Color176196222 );
   public final static Color lightyellow = new Color255255224 );
   public final static Color lime = new Color0255);
   public final static Color limegreen = new Color5020550 );
   public final static Color linen = new Color250240230 );
   public final static Color magenta = new Color2550255 );
   public final static Color maroon = new Color1280);
   public final static Color mediumaquamarine = new Color102205170 );
   public final static Color mediumblue = new Color00205 );
   public final static Color mediumorchid = new Color18685211 );
   public final static Color mediumpurple = new Color147112219 );
   public final static Color mediumseagreen = new Color60179113 );
   public final static Color mediumslateblue = new Color123104238 );
   public final static Color mediumspringgreen = new Color0250154 );
   public final static Color mediumturquoise = new Color72209204 );
   public final static Color mediumvioletred = new Color19921133 );
   public final static Color midnightblue = new Color2525112 );
   public final static Color mintcream = new Color245255250 );
   public final static Color mistyrose = new Color255228225 );
   public final static Color mocassin = new Color255228181 );
   public final static Color navajowhite = new Color255222173 );
   public final static Color navy = new Color00128 );
   public final static Color oldlace = new Color253245230 );
   public final static Color olive = new Color128128);
   public final static Color olivedrab = new Color10714235 );
   public final static Color orange = new Color255165);
   public final static Color orangered = new Color25569);
   public final static Color orchid = new Color218112214 );
   public final static Color palegoldenrod = new Color238232170 );
   public final static Color palegreen = new Color152251152 );
   public final static Color paleturquoise = new Color175238238 );
   public final static Color palevioletred = new Color219112147 );
   public final static Color papayawhip = new Color255239213 );
   public final static Color peachpuff = new Color255218185 );
   public final static Color peru = new Color20513363 );
   public final static Color pink = new Color255192203 );
   public final static Color plum = new Color221160221 );
   public final static Color powderblue = new Color176224230 );
   public final static Color purple = new Color1280128 );
   public final static Color red = new Color2550);
   public final static Color rosybrown = new Color188143143 );
   public final static Color royalblue = new Color65105225 );
   public final static Color saddlebrown = new Color1396919 );
   public final static Color salmon = new Color250128114 );
   public final static Color sandybrown = new Color24416496 );
   public final static Color seagreen = new Color4613987 );
   public final static Color seashell = new Color255245238 );
   public final static Color sienna = new Color1608245 );
   public final static Color silver = new Color192192192 );
   public final static Color skyblue = new Color135206235 );
   public final static Color slateblue = new Color10690205 );
   public final static Color slategray = new Color112128144 );
   public final static Color snow = new Color255250250 );
   public final static Color springgreen = new Color0255127 );
   public final static Color steelblue = new Color70138180 );
   public final static Color tan = new Color210180140 );
   public final static Color teal = new Color0128128 );
   public final static Color thistle = new Color216191216 );
   public final static Color tomato = new Color2539971 );
   public final static Color turquoise = new Color64224208 );
   public final static Color violet = new Color238130238 );
   public final static Color wheat = new Color245222179 );
   public final static Color white = new Color255255255 );
   public final static Color whitesmoke = new Color245245245 );
   public final static Color yellow = new Color255255);
   public final static Color yellowgreen = new Color15420550 );

   private static HashMap _colors;

   private static Object[][] data =
         {
         {"aliceblue", aliceblue},
         {"antiquewhite", antiquewhite},
         {"aqua", aqua},
         {"aquamarine", aquamarine},
         {"azure", azure},
         {"beige", beige},
         {"bisque", bisque},
         {"black", black},
         {"blanchedalmond", blanchedalmond},
         {"blue", blue},
         {"blueviolet", blueviolet},
         {"brown", brown},
         {"burlywood", burlywood},
         {"cadetblue", cadetblue},
         {"chartreuse", chartreuse},
         {"chocolate", chocolate},
         {"coral", coral},
         {"cornflowerblue", cornflowerblue},
         {"cornsilk", cornsilk},
         {"crimson", crimson},
         {"cyan", cyan},
         {"darkblue", darkblue},
         {"darkcyan", darkcyan},
         {"darkgoldenrod", darkgoldenrod},
         {"darkgray", darkgray},
         {"darkgreen", darkgreen},
         {"darkkhaki", darkkhaki},
         {"darkmagenta", darkmagenta},
         {"darkolivegreen", darkolivegreen},
         {"darkorange", darkorange},
         {"darkorchid", darkorchid},
         {"darkred", darkred},
         {"darksalmon", darksalmon},
         {"darkseagreen", darkseagreen},
         {"darkslateblue", darkslateblue},
         {"darkslategray", darkslategray},
         {"darkturquoise", darkturquoise},
         {"darkviolet", darkviolet},
         {"deeppink", deeppink},
         {"deepskyblue", deepskyblue},
         {"dimgray", dimgray},
         {"dodgerblue", dodgerblue},
         {"firebrick", firebrick},
         {"floralwhite", floralwhite},
         {"forestgreen", forestgreen},
         {"fuchsia", fuchsia},
         {"gainsboro", gainsboro},
         {"ghostwhite", ghostwhite},
         {"gold", gold},
         {"goldenrod", goldenrod},
         {"gray", gray},
         {"green", green},
         {"greenyellow", greenyellow},
         {"honeydew", honeydew},
         {"hotpink", hotpink},
         {"indianred", indianred},
         {"indigo", indigo},
         {"ivory", ivory},
         {"khaki", khaki},
         {"lavender", lavender},
         {"lavenderblush", lavenderblush},
         {"lawngreen", lawngreen},
         {"lemonchiffon", lemonchiffon},
         {"lightblue", lightblue},
         {"lightcoral", lightcoral},
         {"lightcyan", lightcyan},
         {"lightgoldenrodyellow", lightgoldenrodyellow},
         {"lightgreen", lightgreen},
         {"lightgrey", lightgrey},
         {"lightpink", lightpink},
         {"lightsalmon", lightsalmon},
         {"lightseagreen", lightseagreen},
         {"lightskyblue", lightskyblue},
         {"lightslategray", lightslategray},
         {"lightsteelblue", lightsteelblue},
         {"lightyellow", lightyellow},
         {"lime", lime},
         {"limegreen", limegreen},
         {"linen", linen},
         {"magenta", magenta},
         {"maroon", maroon},
         {"mediumaquamarine", mediumaquamarine},
         {"mediumblue", mediumblue},
         {"mediumorchid", mediumorchid},
         {"mediumpurple", mediumpurple},
         {"mediumseagreen", mediumseagreen},
         {"mediumslateblue", mediumslateblue},
         {"mediumspringgreen", mediumspringgreen},
         {"mediumturquoise", mediumturquoise},
         {"mediumvioletred", mediumvioletred},
         {"midnightblue", midnightblue},
         {"mintcream", mintcream},
         {"mistyrose", mistyrose},
         {"moccasin", mocassin},
         {"navajowhite", navajowhite},
         {"navy", navy},
         {"oldlace", oldlace},
         {"olive", olive},
         {"olivedrab", olivedrab},
         {"orange", orange},
         {"orangered", orangered},
         {"orchid", orchid},
         {"palegoldenrod", palegoldenrod},
         {"palegreen", palegreen},
         {"paleturquoise", paleturquoise},
         {"palevioletred", palevioletred},
         {"papayawhip", papayawhip},
         {"peachpuff", peachpuff},
         {"peru", peru},
         {"pink", pink},
         {"plum", plum},
         {"powderblue", powderblue},
         {"purple", purple},
         {"red", red},
         {"rosybrown", rosybrown},
         {"royalblue", royalblue},
         {"saddlebrown", saddlebrown},
         {"salmon", salmon},
         {"sandybrown", sandybrown},
         {"seagreen", seagreen},
         {"seashell", seashell},
         {"sienna", sienna},
         {"silver", silver},
         {"skyblue", skyblue},
         {"slateblue", slateblue},
         {"slategray", slategray},
         {"snow", snow},
         {"springgreen", springgreen},
         {"steelblue", steelblue},
         {"tan", tan},
         {"teal", teal},
         {"thistle", thistle},
         {"tomato", tomato},
         {"turquoise", turquoise},
         {"violet", violet},
         {"wheat", wheat},
         {"white", white},
         {"whitesmoke", whitesmoke},
         {"yellow", yellow},
         {"yellowgreen", yellowgreen},
         };

   public static HashMap getColors()
   {
      return _colors;
   }

   public static Color findColorString key )
   {
      return Color _colors.getkey );
   }
   static
   {

      _colors = new HashMap();

      forint i = 0; i < data.length; i++ )
      {
         Object row[] = data[i];
         _colors.putrow[0], row[1] );
      }
   }

}

   
    
    
    
    
  
Related examples in the same category
1.Color class is used to work with colors in Java 2D
2.Color Utilities: common color operations
3.Color Difference
4.Rainbow ColorRainbow Color
5.XOR colorXOR color
6.Color Gradient
7.Common color utilities
8.Drawing with Color
9.Color fading animation
10.Color Util
11.Color Factory
12.An efficient color quantization algorithm
13.Utility for checking colors given either hexa or natural language string descriptions.
14.Derives a color by adding the specified offsets to the base color's hue, saturation, and brightness values
15.Map colors into names and vice versa.
16.Converts a given string into a color.
17.If the color is equal to one of the defined constant colors, that name is returned instead.
18.Converts the String representation of a color to an actual Color object.
www.java2java.com | Contact Us
Copyright 2009 - 12 Demo Source and Support. All rights reserved.
All other trademarks are property of their respective owners.