private String decodeColor(Color color, Color defaultColor) { if (color==null) color = defaultColor; String str = "#"+Integer.toHexString(color.getRGB()); if (str.length()==9 && str.startsWith("#ff")) str = "#"+str.substring(3); String lc = Colors.hexToColor(str); if (lc!=null) str = lc; return str; }
/** Converts a Color into a string ("red", "green", #aa55ff, etc.). */ public static String colorToString(Color color) { String str = color!=null?"#"+Integer.toHexString(color.getRGB()):"none"; if (str.length()==9 && str.startsWith("#ff")) str = "#"+str.substring(3); String str2 = hexToColor(str); return str2!=null?str2:str; }
private String decodeColor(Color color, Color defaultColor) { if (color==null) color = defaultColor; String str = "#"+Integer.toHexString(color.getRGB()); if (str.length()==9 && str.startsWith("#ff")) str = "#"+str.substring(3); String lc = Colors.hexToColor(str); if (lc!=null) str = lc; return str; }
/** Converts a Color into a string ("red", "green", #aa55ff, etc.). */ public static String colorToString(Color color) { String str = color!=null?"#"+Integer.toHexString(color.getRGB()):"none"; if (str.length()==9 && str.startsWith("#ff")) str = "#"+str.substring(3); String str2 = hexToColor(str); return str2!=null?str2:str; }