File: README.md

package info (click to toggle)
golang-github-mitchellh-colorstring 0.0~git20150917.0.8631ce9-1.1
  • links: PTS, VCS
  • area: main
  • in suites: bookworm, bullseye, sid
  • size: 64 kB
  • sloc: makefile: 2
file content (30 lines) | stat: -rw-r--r-- 873 bytes parent folder | download | duplicates (2)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
# colorstring [![Build Status](https://travis-ci.org/mitchellh/colorstring.svg)](https://travis-ci.org/mitchellh/colorstring)

colorstring is a [Go](http://www.golang.org) 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](http://godoc.org/github.com/mitchellh/colorstring).

Usage is easy enough:

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

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