Colour your terminal strings. Inspired by Node's Chalk
- The eight default terminal colours
Get the package:
$ go get -u github.com/bentranter/chalk
Use it:
package main
import (
"fmt"
"github.com/bentranter/chalk"
)
func main() {
// Look at the colours!
fmt.Println(
(chalk.Black("Black")),
(chalk.Red("Red")),
(chalk.Yellow("Yellow")),
(chalk.Green("Green")),
(chalk.Blue("Blue")),
(chalk.Magenta("Magenta")),
(chalk.Cyan("Cyan")),
(chalk.White("White")),
)
// You can change the background colour too!
fmt.Println(
(chalk.BgBlue("My background is blue."))
)
// Or underline words
fmt.Println(
(chalk.Underline("I'm underlined!"))
)
}
Licensed under Apache 2.0. Copyright 2016-2017 Ben Tranter. See license.md.