Documentation ¶
Index ¶
- Constants
- Variables
- func Blue(s string) string
- func Color256(code uint8, s string) string
- func ColorPrintf(format string, v ...interface{})
- func Colorf(format string, a ...interface{}) string
- func CursorOff()
- func CursorOn()
- func Green(s string) string
- func Red(s string) string
- func Yellow(s string) string
Constants ¶
View Source
const ( FgBlack = iota + 30 FgRed FgGreen FgYellow FgBlue FgMagenta FgCyan FgWhite )
Forground colors
View Source
const ( Reset = iota Bold Faint Italic Underlined BlinkSlow BlinkFast Inverted Hidden CrossedOut )
Format modifiers
Variables ¶
View Source
var ( // Output is the default output for the terminal package Output io.Writer )
Functions ¶
func ColorPrintf ¶ added in v0.0.4
func ColorPrintf(format string, v ...interface{})
ColorPrintf is the same as Colorf except it prints the result to standar out.
func Colorf ¶
Colorf will generate a formatted string based on color format codes, so basically fmt.Sprintf but for terminal colors.
Syntax:
%[modifier]<forground>
Forground Colors:
%r - red %g - green %y - yellow %b - blue %m - magenta %c - cyan %w - white %0 - reset (no op)
Modifiers:
%!r - red bold %.r - red faint %'r - red italic %_r - red underlined %?r - red inverted % r - red hidden %-r - red crossed out
Types ¶
This section is empty.
Click to show internal directories.
Click to hide internal directories.