Open thomasballinger opened 10 years ago
i'm flattered :) one thing to consider: that implementation emphasizes readability and flexibility; you can use sgr() to string together complicated rendering commands. one alternative would be to just pre-format a bunch of complete control sequence strings, and provide those as constants. this reduces verbosity and function call overhead for library users at the expense of slightly longer output strings (because you cannot coalesce e.g. bold/white-text/red-background). i think this is a reasonable trade-off, and i would probably take that approach in a new implementation.
:+1: pretty cool
I like the approach of @gwk in https://github.com/gwk/gloss/blob/master/python/gloss/io/sgr.py, I think we should copy that for the most part.