patch color

This commit is contained in:
Yaode_owo 2024-07-27 05:20:22 -04:00
parent 72dc02951a
commit 02a93f0b21

View file

@ -126,7 +126,7 @@ function parseMinecraftMessage(component) {
const green = parseInt(hexCodes[2], 16);
const blue = parseInt(hexCodes[3], 16);
const ansiColor = `\u001b[38;2;${red};${green};${blue}m`;
text += ansiColorCodes[comp.color] + extractText(subComp) + ansiFormatCodes['reset'];
text += ansiColor + extractText(subComp) + ansiFormatCodes['reset'];
}
}
}
@ -146,6 +146,9 @@ function parseMinecraftMessage(component) {
}
text += translateString;
}
if (comp.bold && comp.bold === 1) {
text = ansiFormatCodes['bold'] + text;
} // i dont know why add bold, some color dont show, maybe is my issue or code.
if (comp.color && ansiColorCodes[comp.color] && !comp.color.startsWith('#')) {
text = ansiColorCodes[comp.color] + text + ansiFormatCodes['reset'];
} else if (comp.color && comp.color.startsWith('#')) {
@ -159,9 +162,6 @@ function parseMinecraftMessage(component) {
text = ansiColor + text + ansiFormatCodes['reset'];
}
}
if (comp.bold && comp.bold === 1) {
text = ansiFormatCodes['bold'] + text;
} // i dont know why add bold, some color dont show, maybe is my issue or code.
if (comp.italic && comp.italic === 1) { // useless
text = ansiFormatCodes['italic'] + text;
}