Here you can find the source of StringToColor(String name)
public static Color StringToColor(String name)
//package com.java2s; import java.awt.Color; import java.util.Hashtable; public class Main { static private Hashtable<String, Color> reverseColorsHashtable = null; public static Color StringToColor(String name) { Color new_color = null; try {/*from w w w . java 2 s .c o m*/ if (null != reverseColorsHashtable) { new_color = reverseColorsHashtable.get(name); } } catch (Exception e) { e.printStackTrace(); } try { if (null == new_color) { new_color = Color.getColor(name); } } catch (Exception e) { e.printStackTrace(); } return new_color; } }