From 8e956c930278719f3ec5c2739c338d9224b0666f Mon Sep 17 00:00:00 2001 From: Felix Pankratz Date: Sat, 20 Jun 2020 17:28:24 +0200 Subject: [PATCH] 4 bit bg and fg together --- terminalcolors.py | 10 +++------- 1 file changed, 3 insertions(+), 7 deletions(-) diff --git a/terminalcolors.py b/terminalcolors.py index 125150b..f9bc915 100755 --- a/terminalcolors.py +++ b/terminalcolors.py @@ -2,16 +2,12 @@ default = "\033[0m" bar = " " def colors4(): - print("4 Bit background colors") seq_template = "\033[{};{}m{}" + text_template = seq_template + " The quick brown fox jumps over the lazy dog" bold_template= "\033[{};{};1m{} The quick brown fox jumps over the lazy dog" - for color in range(40, 48): - print(seq_template.format(30, color, color) + bar + default) - print() - print("4 Bit foreground colors Bold") - seq_template += " The quick brown fox jumps over the lazy dog " + print("4 Bit colors (\\033[30;m) Bold (\\033[30;;1m)") for color in range(30, 38): - print(seq_template.format(30, color, color) + bold_template.format(30, color, color) + default) + print(seq_template.format(30, color+10, color+10) + bar + default + " " + text_template.format(30, color, color) + " " + bold_template.format(30, color, color) + default) print def colors8():