color

package
v0.19.1 Latest Latest
Warning

This package is not in the latest version of its module.

Go to latest
Published: Apr 5, 2020 License: Apache-2.0, Apache-2.0 Imports: 1 Imported by: 0

Documentation

Index

Constants

View Source
const ColorFmt = "\x1b[%dm%s\x1b[0m"

ColorFmt colorize a string with ansi colors.

Variables

This section is empty.

Functions

func Colorize

func Colorize(s string, c Paint) string

Colorize returns an ASCII colored string based on given color.

Types

type Paint

type Paint int

Paint describes a terminal color.

const (
	Black     Paint = iota + 30 // 30
	Red                         // 31
	Green                       // 32
	Yellow                      // 33
	Blue                        // 34
	Magenta                     // 35
	Cyan                        // 36
	LightGray                   // 37
	DarkGray  = 90

	Bold = 1
)

Defines basic ANSI colors.

Jump to

Keyboard shortcuts

? : This menu
/ : Search site
f or F : Jump to
y or Y : Canonical URL