about summary refs log tree commit diff stats
path: root/doc/print_colors.py
diff options
context:
space:
mode:
authorhut <hut@lavabit.com>2010-03-24 14:05:08 +0100
committerhut <hut@lavabit.com>2010-03-24 14:05:08 +0100
commit55435343b142c424619e3072475ca8b3366d109c (patch)
tree55c5ba8d815bd2d4cfca2086dba998eaebb83067 /doc/print_colors.py
parentefbde17048b14d43895e4cf91e798fb97702b68f (diff)
parent0a16f0da970ae344f0094767c08995dd63f616cb (diff)
downloadranger-55435343b142c424619e3072475ca8b3366d109c.tar.gz
Merge branch 'master' into newkey
Conflicts:
	ranger/api/keys.py
	ranger/container/commandlist.py
	ranger/core/actions.py
	ranger/defaults/keys.py
	ranger/gui/ui.py
	ranger/gui/widgets/browserview.py
Diffstat (limited to 'doc/print_colors.py')
-rwxr-xr-xdoc/print_colors.py23
1 files changed, 23 insertions, 0 deletions
diff --git a/doc/print_colors.py b/doc/print_colors.py
new file mode 100755
index 00000000..7ffd6500
--- /dev/null
+++ b/doc/print_colors.py
@@ -0,0 +1,23 @@
+#!/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()
+