nsf/termbox-go — pull request #8 by swdunlop (2012-09-28 07:12:21+00:00)
Title: Add 256 Color and Palette Support

These changes add 256 color support to termbox by providing an explicit mode switch (SetColorMode) that does a naive check for supported terminal type. XTERM color palette assignments are also supported.

Changes have been tested in putty, VTE, xterm and rxvt-unicode in both 16 and 256 color modes. (Some of these terminals will require a tweak to $TERM, such as "xterm" to "xterm-256color.")

A demo, duplicating the effect of http://frexx.de/xterm-256-notes/data/256colors2.pl is available in _demo/rainbow.go. The remaining demos were tweaked to use relative paths so development forks can build normally adjacent to mainline nsf/termbox.