From 606461a6508de411f48fba2aea125bfb8b33393f Mon Sep 17 00:00:00 2001 From: Some-O-ne Date: Wed, 24 Sep 2025 14:14:08 +0300 Subject: [PATCH] truecolor micron markup support :D --- nomadnet/ui/textui/MicronParser.py | 18 +++++++++++++----- 1 file changed, 13 insertions(+), 5 deletions(-) diff --git a/nomadnet/ui/textui/MicronParser.py b/nomadnet/ui/textui/MicronParser.py index 00507a7..7132c2b 100644 --- a/nomadnet/ui/textui/MicronParser.py +++ b/nomadnet/ui/textui/MicronParser.py @@ -467,16 +467,24 @@ 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] + if line[i+1] == "T": # truecolor support (`FT040506) + color = line[i+2:i+8] + skip = 7 + else: + color = line[i+1:i+4] + skip = 3 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": # truecolor support (`BT040506) + color = line[i+2:i+8] + skip = 7 + else: + color = line[i+1:i+4] + skip = 3 + state["bg_color"] = color elif c == "b": state["bg_color"] = state["default_bg"] elif c == "`":