Documentation ¶
Overview ¶
ANSI Color formatting
Based partly on http://pypi.python.org/pypi/termcolor
Examples
log.Println(termcolor.Colored("My string", termcolor.Red, termcolor.Bold)) log.Println(termcolor.ColoredWithBackground("My string", termcolor.Green, termcolor.BgWhite, termcolor.Underline))
Index ¶
Constants ¶
View Source
const Reset = "\033[0m"
Variables ¶
View Source
var ( Bold Attribute = 1 Dark Attribute = 2 Reverse Attribute = 7 Underline Attribute = 4 Blue Color = 34 Cyan Color = 36 Green Color = 32 Grey Color = 30 Magenta Color = 35 Red Color = 31 White Color = 37 Yellow Color = 33 BgBlue Background = 44 BgCyan Background = 46 BgGreen Background = 42 BgGrey Background = 40 BgMagenta Background = 45 BgRed Background = 41 BgWhite Background = 47 BgYellow Background = 43 )
Functions ¶
func ColoredWithBackground ¶
func ColoredWithBackground(text string, color Color, background Background, attributes ...Attribute) (ret string)
Types ¶
type Background ¶
type Background int
Click to show internal directories.
Click to hide internal directories.