github.com/felix/colour (go): Package colour is an ANSI colour package to output colourized or SGR defined output to the standard output. The API can be used in several way, pick one that suits you.  Use simple and default helper functions with predefined foreground colours:  However there are times where custom colour mixes are required. Below are some examples to create custom colour objects and use the print functions of each separate colour object.  You can create PrintXxx functions to simplify even more:  You can also FprintXxx functions to pass your own io.Writer:  Or create SprintXxx functions to mix strings with other non-colourized strings:  Windows support is enabled by default. All Print functions work as intended. However only for colour.SprintXXX functions, user should use fmt.FprintXXX and set the output to colour.Output:  Using with existing code is possible. Just use the Set() method to set the standard output to the given parameters. That way a rewrite of an existing code is not required.  There might be a case where you want to disable colour output (for example to pipe the standard output of your app to somewhere else). `Colour` has support to disable colours both globally and for single colour definition. For example suppose you have a CLI app and a `--no-colour` bool flag. You can easily disable the colour output with:  It also has support for single colour definitions (local). You can disable/enable colour output on the fly:
Keywords: color|colour|go|golang|tty