public static Color decode(String color,Color defaultColor){
  if (color == null) {
    return defaultColor;
  }
  Color c=getNamedColor(color);
  if (c == null) {
    try {
      c=Color.decode(color);
    }
 catch (    NumberFormatException ex) {
      return defaultColor;
    }
  }
  return c;
}

public static Color decode ( String color , Color defaultColor ) { if ( color == null ) { return defaultColor ; } Color c = getNamedColor ( color ) ; if ( c == null ) { try { c = Color . decode ( color ) ; } catch ( NumberFormatException ex ) { return defaultColor ; } } return c ; }
decodes an html color and turns it into a color object . supports some named colors and string formats that are supported by color . decode ( ) . if no color can be decoded , returns the defaultcolor specified by the caller .
