Go (golang) library for colorizing strings for terminal output.
Go
Switch branches/tags
Nothing to show
Clone or download
1
Latest commit 8631ce9 Sep 18, 2015
Permalink
Failed to load latest commit information.
.travis.yml update travis.yml Jul 13, 2014
LICENSE Initial commit, works Jul 12, 2014
README.md Updated README.md with convenience method example Feb 28, 2015
colorstring.go ColorPrefix Sep 17, 2015
colorstring_test.go ColorPrefix Sep 17, 2015

README.md

colorstring Build Status

colorstring is a Go library for outputting colored strings to a console using a simple inline syntax in your string to specify the color to print as.

For example, the string [blue]hello [red]world would output the text "hello world" in two colors. The API of colorstring allows for easily disabling colors, adding aliases, etc.

Installation

Standard go get:

$ go get github.com/mitchellh/colorstring

Usage & Example

For usage and examples see the Godoc.

Usage is easy enough:

colorstring.Println("[blue]Hello [red]World!")

Additionally, the Colorize struct can be used to set options such as custom colors, color disabling, etc.