Documentation ¶
Index ¶
- Constants
- func Black(args ...interface{}) string
- func Blue(args ...interface{}) string
- func ColoredBytes(data []byte, textColor, bytesColor func(...interface{}) string) string
- func ColoredBytesN(data []byte, n int, textColor, bytesColor func(...interface{}) string) string
- func Cyan(args ...interface{}) string
- func DefaultColoredBytes(data []byte) string
- func DefaultColoredBytesN(data []byte, n int) string
- func Gray(args ...interface{}) string
- func Green(args ...interface{}) string
- func Magenta(args ...interface{}) string
- func None(args ...interface{}) string
- func Red(args ...interface{}) string
- func White(args ...interface{}) string
- func Yellow(args ...interface{}) string
- type Color
Constants ¶
View Source
const ( ANSIReset = "\x1b[0m" ANSIBright = "\x1b[1m" ANSIDim = "\x1b[2m" ANSIUnderscore = "\x1b[4m" ANSIBlink = "\x1b[5m" ANSIReverse = "\x1b[7m" ANSIHidden = "\x1b[8m" ANSIFgBlack = "\x1b[30m" ANSIFgRed = "\x1b[31m" ANSIFgGreen = "\x1b[32m" ANSIFgYellow = "\x1b[33m" ANSIFgBlue = "\x1b[34m" ANSIFgMagenta = "\x1b[35m" ANSIFgCyan = "\x1b[36m" ANSIFgWhite = "\x1b[37m" ANSIFgGray = "\x1b[90m" // bright black ANSIBgBlack = "\x1b[40m" ANSIBgRed = "\x1b[41m" ANSIBgGreen = "\x1b[42m" ANSIBgYellow = "\x1b[43m" ANSIBgBlue = "\x1b[44m" ANSIBgMagenta = "\x1b[45m" ANSIBgCyan = "\x1b[46m" ANSIBgWhite = "\x1b[47m" )
Variables ¶
This section is empty.
Functions ¶
func ColoredBytes ¶
func ColoredBytesN ¶
result may be 4 ASNSII chars longer than they should be to denote the elipses (...), and one for a trailing hex nibble in case the last byte is non-ascii. NOTE: it is annoying to try make this perfect and always fit within n, so we don't do this yet, but left as an exercise. :)
func DefaultColoredBytes ¶
func DefaultColoredBytesN ¶
Types ¶
Click to show internal directories.
Click to hide internal directories.