+ /* Structures */
+ static class Color {
+ public int code;
+ public String hex;
+ public String name;
+
+ public Color(int code, String hex, String name)
+ {
+ this.code = code;
+ this.hex = hex;
+ this.name = name;
+ }
+ };
+
+ static class Format implements Cloneable {
+ public boolean bold;
+ public boolean italic;
+ public boolean strike;
+ public boolean underline;
+ public boolean reverse;
+ public Color fg;
+ public Color bg;
+ public String txt;
+
+ public Format clone()
+ {
+ try {
+ return (Format)super.clone();
+ } catch (Exception e) {
+ return null;
+ }
+ }
+
+ public String toString()
+ {
+ return (fg!=null ? fg.hex : "xxxxxx") + ":" +
+ (bg!=null ? bg.hex : "xxxxxx") + ":" +
+ (bold ? "b" : "-" ) +
+ (italic ? "i" : "-" ) +
+ (strike ? "s" : "-" ) +
+ (underline ? "u" : "-" ) +
+ (reverse ? "r" : "-" ) + ":" +
+ "[" + txt + "]";
+ }
+ };
+
+ /* Colors */
+ private static final Color colors[] = {
+ new Color(0x0, "FFFFFF", "White"),
+ new Color(0x1, "000000", "Black"),
+ new Color(0x2, "000080", "Navy Blue"),
+ new Color(0x3, "008000", "Green"),
+ new Color(0x4, "FF0000", "Red"),
+ new Color(0x5, "804040", "Brown"),
+ new Color(0x6, "8000FF", "Purple"),
+ new Color(0x7, "808000", "Olive"),
+ new Color(0x8, "FFFF00", "Yellow"),
+ new Color(0x9, "00FF00", "Lime Green"),
+ new Color(0xA, "008080", "Teal"),
+ new Color(0xB, "00FFFF", "Aqua Light"),
+ new Color(0xC, "0000FF", "Royal Blue"),
+ new Color(0xD, "FF00FF", "Hot Pink"),
+ new Color(0xE, "808080", "Dark Gray"),
+ new Color(0xF, "C0C0C0", "Light Gray"),
+ };
+