<div dir="ltr"><div><div><div><div><div><div><div>Hi all,<br><br></div>rainbow is a simple package to help you print colored text on UNIX-like systems. It's different from packages like terminfo (upon which it is based) and ansi-terminal in two ways. First, rainbow assumes you print text one "chunk" at a time. The properties of the terminal are reset with every chunk. That way you do not need to remember what the terminal's properties were before you print a new chunk. One chunk does not affect the next chunk. It's a state-free model that fits in well with functional programming.<br>
<br>Second, rainbow makes it easy to use both 8- and 256-color terminals.<br><br></div>Some sample things you can do in ghci:<br><br></div>:set -XOverloadedStrings<br></div>:m +System.Console.Rainbow<br></div>putChunkLn $ "Hello bold green world!" <> f_green <> bold<br>
</div>putChunkLn $ "Red on 8-color, pink on 256-color" <> f_red <> c256_f_201<br>mapM_ putChunk ["green on blue" <> f_green <> b_blue, " ", "blue on green" <> f_blue <> b_green, "\n"]<br>
<br></div>So, add some color to things:<br><br><a href="http://hackage.haskell.org/package/rainbow">http://hackage.haskell.org/package/rainbow</a><br></div>