All Projects → mitchellh → Colorstring

mitchellh / Colorstring

Licence: mit
Go (golang) library for colorizing strings for terminal output.

Programming Languages

go
31211 projects - #10 most used programming language

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.

Note that the project description data, including the texts, logos, images, and/or trademarks, for each open source project belongs to its rightful owner. If you wish to add or remove any projects, please contact us at [email protected].