From 6866d97cf64b7cdbb9e785034da20eea73e2df03 Mon Sep 17 00:00:00 2001 From: Mark Qvist Date: Mon, 6 Apr 2026 18:47:06 +0200 Subject: [PATCH] True-color support --- nomadnet/ui/textui/MicronParser.py | 22 ++++++++++++++++------ 1 file changed, 16 insertions(+), 6 deletions(-) diff --git a/nomadnet/ui/textui/MicronParser.py b/nomadnet/ui/textui/MicronParser.py index d8adbb4..a53e614 100644 --- a/nomadnet/ui/textui/MicronParser.py +++ b/nomadnet/ui/textui/MicronParser.py @@ -498,16 +498,26 @@ def make_output(state, line, url_delegate, pre_escape=False): state["formatting"]["italic"] ^= True elif c == "F": if len(line) >= i+4: - color = line[i+1:i+4] - state["fg_color"] = color - skip = 3 + if line[i+1] == "T" and len(line) >= i+8: + color = line[i+2:i+8] + state["fg_color"] = color + skip = 7 + else: + color = line[i+1:i+4] + state["fg_color"] = color + skip = 3 elif c == "f": state["fg_color"] = state["default_fg"] elif c == "B": if len(line) >= i+4: - color = line[i+1:i+4] - state["bg_color"] = color - skip = 3 + if line[i+1] == "T" and len(line) >= i+8: + color = line[i+2:i+8] + state["bg_color"] = color + skip = 7 + else: + color = line[i+1:i+4] + state["bg_color"] = color + skip = 3 elif c == "b": state["bg_color"] = state["default_bg"] elif c == "`":