ceci n'est pas un nouveau version
[ranger.git] / doc / print_colors.py
blobc3508fa6b9ccc5cf3b3a3b24c4f8bed901e2dd80
1 #!/usr/bin/env python
2 """
3 You can use this tool to display all supported colors and their color number.
4 It will exit after a keypress.
5 """
7 import curses
8 from curses import *
10 @wrapper
11 def main(win):
12 def print_all_colors(attr):
13 for c in range(0, curses.COLORS):
14 init_pair(c, c, -1)
15 win.addstr(str(c) + ' ', color_pair(c) | attr)
16 use_default_colors()
17 win.addstr("available colors: %d\n\n" % curses.COLORS)
18 print_all_colors(0)
19 win.addstr("\n\n")
20 print_all_colors(A_BOLD)
21 win.refresh()
22 win.getch()