From 84f516f6a3759eadda49892d3351c3a71dd3e874 Mon Sep 17 00:00:00 2001 From: Some-O-ne <70059895+Some-O-ne@users.noreply.github.com> Date: Tue, 10 Mar 2026 20:36:17 +0000 Subject: [PATCH] Truecolor \`B and \`F tags Developers could utilize the whole 16777216 colors instead of 4096, which is cool imo :D --- src/frontend/js/MicronParser.js | 16 +++++++++++++++- 1 file changed, 15 insertions(+), 1 deletion(-) diff --git a/src/frontend/js/MicronParser.js b/src/frontend/js/MicronParser.js index 9222dd2..ad96e7b 100644 --- a/src/frontend/js/MicronParser.js +++ b/src/frontend/js/MicronParser.js @@ -462,7 +462,13 @@ class MicronParser { state.formatting.italic = !state.formatting.italic; break; case 'F': - // next 3 chars = fg color + if (line[i+1] == "T" && line.length >= i+8) { // truecolor tags (`FTxxxxxx) + let color = line.substr(i+2,6); + state.fg_color = color; + skip = 7; + break; + } + // next 3 chars => bg color if (line.length >= i+4) { let color = line.substr(i+1,3); state.fg_color = color; @@ -474,12 +480,20 @@ class MicronParser { state.fg_color = this.SELECTED_STYLES.plain.fg; break; case 'B': + if (line[i+1] == "T" && line.length >= i+8) { // truecolor tags (`BTxxxxxx) + let color = line.substr(i+2,6); + state.bg_color = color; + skip = 7; + break; + } + // next 3 chars => bg color if (line.length >= i+4) { let color = line.substr(i+1,3); state.bg_color = color; skip = 3; } break; + case 'b': // reset bg state.bg_color = this.DEFAULT_BG;