From 3830653cd092e5ad246bbdfcac3633cd705024a0 Mon Sep 17 00:00:00 2001 From: Samir Benmendil Date: Wed, 10 Dec 2014 02:57:38 +0000 Subject: [PATCH] bin: add script to output curses colors --- bin/curses-color | 20 ++++++++++++++++++++ 1 file changed, 20 insertions(+) create mode 100755 bin/curses-color diff --git a/bin/curses-color b/bin/curses-color new file mode 100755 index 0000000..39c584d --- /dev/null +++ b/bin/curses-color @@ -0,0 +1,20 @@ +#!/usr/bin/env python + +import curses + +def main(stdscr): + curses.start_color() + curses.use_default_colors() + for i in range(0, curses.COLORS): + curses.init_pair(i + 1, i, -1) + try: + for i in range(0, 256): + x = 4*(i % 16) + y = int(i / 16) + stdscr.addstr(y, x,str(i), curses.color_pair(i)) + except curses.ERR: + # End of screen reached + pass + stdscr.getch() + +curses.wrapper(main) -- 2.48.1