Skip to content

Instantly share code, notes, and snippets.

@sagz
Last active December 25, 2015 09:29
Show Gist options
  • Save sagz/6954158 to your computer and use it in GitHub Desktop.
Save sagz/6954158 to your computer and use it in GitHub Desktop.
Print all 256 ANSI colours in the terminal with this Python code snippet
def colour(this_colour, string):
return "\033[" + this_colour + "m" + string + "\033[0m"
for i in range(256):
c = '38;05;%d' % i
print( colour(c, 'colour ' + c) )
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment