Ecosyste.ms: Awesome
An open API service indexing awesome lists of open source software.
https://github.com/mitchellh/colorstring
Go (golang) library for colorizing strings for terminal output.
https://github.com/mitchellh/colorstring
Last synced: 3 months ago
JSON representation
Go (golang) library for colorizing strings for terminal output.
- Host: GitHub
- URL: https://github.com/mitchellh/colorstring
- Owner: mitchellh
- License: mit
- Created: 2014-07-12T16:34:43.000Z (over 10 years ago)
- Default Branch: master
- Last Pushed: 2020-03-27T09:13:22.000Z (over 4 years ago)
- Last Synced: 2024-07-16T14:04:00.920Z (4 months ago)
- Language: Go
- Size: 13.7 KB
- Stars: 276
- Watchers: 7
- Forks: 27
- Open Issues: 5
-
Metadata Files:
- Readme: README.md
- License: LICENSE
Awesome Lists containing this project
README
# 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.