Documentation ¶
Index ¶
Constants ¶
This section is empty.
Variables ¶
View Source
var ResetSetter = func() ColorSetter { color := ColorFormat(Reset) return func(isTerminal bool) string { if !isTerminal { return "" } return color } }()
Functions ¶
func ColorFormat ¶
func ColorFormat(attrs ...ColorAttribute) string
Types ¶
type ColorAttribute ¶
type ColorAttribute int
ColorAttribute defines a single SGR Code
const ( Reset ColorAttribute = iota Bold Faint Italic Underline BlinkSlow BlinkRapid ReverseVideo Concealed CrossedOut )
Base attributes
const ( FgBlack ColorAttribute = iota + 30 FgRed FgGreen FgYellow FgBlue FgMagenta FgCyan FgWhite )
Foreground text colors
const ( FgHiBlack ColorAttribute = iota + 90 FgHiRed FgHiGreen FgHiYellow FgHiBlue FgHiMagenta FgHiCyan FgHiWhite )
Foreground Hi-Intensity text colors
const ( BgBlack ColorAttribute = iota + 40 BgRed BgGreen BgYellow BgBlue BgMagenta BgCyan BgWhite )
Background text colors
const ( BgHiBlack ColorAttribute = iota + 100 BgHiRed BgHiGreen BgHiYellow BgHiBlue BgHiMagenta BgHiCyan BgHiWhite )
Background Hi-Intensity text colors
type ColorSetter ¶
func GetColorSetter ¶
func GetColorSetter(name string) ColorSetter
func SetColorSetter ¶
func SetColorSetter(name string, setter ColorSetter) ColorSetter
type Console ¶
type Console struct {
// contains filtered or unexported fields
}
func NewConsole ¶
func NewConsole() *Console
Click to show internal directories.
Click to hide internal directories.