/** * Returns the color represented by a string. The input is expected to * be a 6-digit hex string, optionally prefixed by a '$'. For example, * either of the following: * <pre> * "$00ff00" * "00ff00" * </pre> * will return <code>new Color(0, 255, 0)</code>. * * @param s The string to evaluate. * @return The color. */ private static Color stringToColor(String s) { return stringToColor(s, null); }
/** * Returns the color represented by a string. The input is expected to * be a 6-digit hex string, optionally prefixed by a '$'. For example, * either of the following: * <pre> * "$00ff00" * "00ff00" * </pre> * will return <code>new Color(0, 255, 0)</code>. * * @param s The string to evaluate. * @return The color. */ private static Color stringToColor(String s) { return stringToColor(s, null); }