summary refs log blame commit diff stats
path: root/doc/print_colors.py
blob: 7ffd6500a844632042fe0808d240a02938281eaf (plain) (tree)
1
2
3
4
5
pre { line-height: 125%; }
td.linenos .normal { color: inherit; background-color: transparent; padding-left: 5px; padding-right: 5px; }
span.linenos { color: inherit; background-color: transparent; padding-left: 5px; padding-right: 5px; }
td.linenos .special { color: #000000; background-color: #ffffc0; padding-left: 5px; padding-right: 5px; }
span.linenos.special { color: #000000; background-color: #ffffc0; padding-left: 5px; padding-right: 5px; }
.highlight .hll { background-color: #ffffcc }
.highlight .c { color: #888888 } /* Comment */
.highlight .err { color: #a61717; background-color: #e3d2d2 } /* Error */
.highlight .k { color: #008800; font-weight: bold } /* Keyword */
.highlight .ch { color: #88888
#!/usr/bin/python
"""
You can use this tool to display all supported colors and their color number.
It will exit after a keypress.
"""

import curses
from curses import *

@wrapper
def main(win):
	def print_all_colors(attr):
		for c in range(0, curses.COLORS):
			init_pair(c, c, -1)
			win.addstr(str(c) + ' ', color_pair(c) | attr)
	use_default_colors()
	win.addstr("available colors: %d\n\n" % curses.COLORS)
	print_all_colors(0)
	win.addstr("\n\n")
	print_all_colors(A_BOLD)
	win.refresh()
	win.getch()
ode>