Last active
June 7, 2021 14:47
-
-
Save heiner/f7b2c03159d93f4f2895a4533c74d0ca to your computer and use it in GitHub Desktop.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
BRIGHT = 8 | |
def color(s, fg, bg): | |
return "\033[%d;3%d;4%dm%s\033[0m" % ( | |
bool(fg & BRIGHT), | |
fg & ~BRIGHT, | |
bg & ~BRIGHT, | |
s, | |
) | |
for fg in range(16): | |
for bg in range(8): | |
print(color("Eric!", fg, bg), end="") | |
print("") |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment