Documentation
¶
Overview ¶
The colors package provide a simple way to bring colorful characters to terminal interface.
This example will output the text with a Blue foreground and a Black background
color.Println("@{bK}Example Text")
This one will output the text with a red foreground
color.Println("@rExample Text")
This one will escape the @
color.Println("@@")
Full color syntax code
@{rgbcmykwRGBCMYKW} foreground/background color r/R: Red g/G: Green b/B: Blue c/C: Cyan m/M: Magenta y/Y: Yellow k/K: Black w/W: White @{|} Reset format style @{!./_} Bold / Dim / Italic / Underline @{^&} Blink / Fast blink @{*} High intensity foreground color @{?} Reverse the foreground and background color @{-} Hide the text
Note some of the functions are not widely supported, like "Fast blink" and "Italic".
Index ¶
- Constants
- func Colorize(x string) string
- func Errorf(format string, a ...interface{}) error
- func Fprint(w io.Writer, a ...interface{}) (int, error)
- func Fprintf(w io.Writer, format string, a ...interface{}) (int, error)
- func Fprintln(w io.Writer, a ...interface{}) (int, error)
- func Print(a ...interface{}) (int, error)
- func Printf(format string, a ...interface{}) (int, error)
- func Println(a ...interface{}) (int, error)
- func Sprint(a ...interface{}) string
- func Sprintf(format string, a ...interface{}) string
Constants ¶
View Source
const ( EscapeChar = '@' // Escape character for color syntax ResetCode = "\033[0m" // Short for reset to default style )
Variables ¶
This section is empty.
Functions ¶
Types ¶
This section is empty.
Click to show internal directories.
Click to hide internal directories.