def color(c, s): return ansi.set_foreground(c) + s + ansi.set_foreground(ansi.black)
def color(c, s): return ansi.set_foreground(c) + s + ansi.set_foreground(ansi.default_color)
def set_color((bg, fg)): sys.stdout.write(ansi.set_background(bg)) sys.stdout.write(ansi.set_foreground(fg))