4 ms·
Indeed, I made my own one of these a few years ago, it was really just a module defining a bunch of constants. Well, not entirely constants. Rather than definin
by ekimekim 14y ago
Indeed, I made my own one of these a few years ago, it was really just a module defining a bunch of constants.
Well, not entirely constants. Rather than defining, say, FG_RED, BG_RED, FG_GREEN, BG_GREEN, etc. I had functions FG and BG that took color codes, like FG(RED) + BG(GREEN) + BOLD + "Garish horrible colors!!" + RESET.
Actually I prefer working in inline escapes like that to curses overly complex method of defining color pairs and only ever specifying which to use at write-time. I wish curses had some way to inline attributes in a piece of text, that I can then use as normal data, pass around, etc.