From 6fafe8a8de9272ff1273a996b6a39f8980ad57a5 Mon Sep 17 00:00:00 2001 From: khuxkm fbexl Date: Sat, 15 Dec 2018 22:57:23 -0500 Subject: [PATCH] Add function to replace colors by name --- clients/urwid/main.py | 8 ++++++++ 1 file changed, 8 insertions(+) diff --git a/clients/urwid/main.py b/clients/urwid/main.py index d95b505..5ff4317 100644 --- a/clients/urwid/main.py +++ b/clients/urwid/main.py @@ -273,6 +273,14 @@ colormap = [ ("60", "light magenta", "default") ] +def replace_color(name,fg,bg=None): + for i,t in enumerate(colormap): + t = list(t) + if t[0]==name: + t[1] = fg + t[2] = bg if bg is not None else t[2] + colormap.__setitem__(i,tuple(t)) + escape_map = { key: urwid.vterm.ESC + sequence for sequence, key in urwid.escape.input_sequences