support more formatting

This commit is contained in:
Lee 2024-04-16 20:53:27 +01:00
parent bedde3b0eb
commit 924e045a18

@ -75,12 +75,21 @@ public final class ColorUtils {
nextIsColor = true; nextIsColor = true;
continue; continue;
} }
if (nextIsColor) { // Map the current color to its hex code if (nextIsColor && !String.valueOf(character).equals("|")) { // Map the current color to its hex code
String color = COLOR_MAP.getOrDefault(Character.toLowerCase(character), ""); String color = COLOR_MAP.getOrDefault(Character.toLowerCase(character), "");
builder.append("<span style=\"color:").append(color); builder.append("<span style=\"color:").append(color);
if (character == 'l') { // Make the char bold if (character == 'l') { // Make the char bold
builder.append(";font-weight:bold"); builder.append(";font-weight:bold");
} }
if (character == 'n') { // Make the char underlined
builder.append(";text-decoration:underline");
}
if (character == 'o') { // Make the char italic
builder.append(";font-style:italic");
}
if (character == 'm') { // Make the char strikethrough
builder.append(";text-decoration:line-through");
}
builder.append("\">"); builder.append("\">");
nextIsColor = false; nextIsColor = false;
continue; continue;