/** * Converts a <CODE>Color</CODE> into a HTML representation of this <CODE> * Color</CODE>. * * @param s * the <CODE>Color</CODE> that has to be converted. * @return the HTML representation of this <COLOR>Color </COLOR> */ public static Color decodeColor(String s) { if (s == null) return null; s = s.toLowerCase().trim(); try { return WebColors.getRGBColor(s); } catch(IllegalArgumentException iae) { return null; } }
if (!NAMES.containsKey(name)) throw new IllegalArgumentException("Color '" + name + "' not found."); c = (int[]) NAMES.get(name); return new Color(c[0], c[1], c[2], c[3]);
if (!NAMES.containsKey(name)) throw new IllegalArgumentException("Color '" + name + "' not found."); c = (int[]) NAMES.get(name); return new Color(c[0], c[1], c[2], c[3]);
if (!NAMES.containsKey(name)) throw new IllegalArgumentException("Color '" + name + "' not found."); c = (int[]) NAMES.get(name); return new Color(c[0], c[1], c[2], c[3]);
/** * Converts a <CODE>Color</CODE> into a HTML representation of this <CODE> * Color</CODE>. * * @param s * the <CODE>Color</CODE> that has to be converted. * @return the HTML representation of this <COLOR>Color </COLOR> */ public static Color decodeColor(String s) { if (s == null) return null; s = s.toLowerCase().trim(); try { return WebColors.getRGBColor(s); } catch(IllegalArgumentException iae) { return null; } }
/** * Converts a <CODE>Color</CODE> into a HTML representation of this <CODE> * Color</CODE>. * * @param s * the <CODE>Color</CODE> that has to be converted. * @return the HTML representation of this <COLOR>Color </COLOR> */ public static Color decodeColor(String s) { if (s == null) return null; s = s.toLowerCase(Locale.ROOT).trim(); try { return WebColors.getRGBColor(s); } catch(IllegalArgumentException iae) { return null; } }