reference for 8 bit

This commit is contained in:
Felix Pankratz 2020-06-20 17:32:18 +02:00
parent 8e956c9302
commit 7fd85c6b8e

View File

@ -11,18 +11,16 @@ def colors4():
print print
def colors8(): def colors8():
print("8 bit colors") print("8 bit colors (\\033[48;5;<color>m{})")
seq_template = "\033[{};{};{}m{}" seq_template = "\033[{};{};{}m{}"
for color in range(16, 255): for color in range(16, 255):
if color < 100: if color < 100:
seq_template = "\033[{};{};{}m {} " seq_template = "\033[{};{};{}m {} "
else: else:
seq_template = "\033[{};{};{}m {} " seq_template = "\033[{};{};{}m {} "
# colorstring = "".join(seq_template.format(48, 5, i, i) for i in range(color, color + 36 ))
print(seq_template.format(48, 5, color, color), end='') print(seq_template.format(48, 5, color, color), end='')
if color % 36 == 15: if color % 36 == 15:
print() print()
#print(seq_template.format(48, 5, color) + bar + default)
print() print()
def main(): def main():
colors4() colors4()