Documentation
¶
Index ¶
Constants ¶
View Source
const ( SGRStart = "\x1b[" Fg = "38;05;" Bg = "48;05;" SGREnd = "m" )
Text effects.
Variables ¶
View Source
var ( Reset = "\x1b[0m" Bold = "\x1b[1m" Dim = "\x1b[2m" Underscore = "\x1b[4m" Blink = "\x1b[5m" Reverse = "\x1b[7m" // Effects reset. BoldReset = "\x1b[22m" // 21 actually causes underline instead DimReset = "\x1b[22m" UnderscoreReset = "\x1b[24m" BlinkReset = "\x1b[25m" ReverseReset = "\x1b[27m" )
Base text effects.
View Source
var ( FgBlack = "\x1b[30m" FgRed = "\x1b[31m" FgGreen = "\x1b[32m" FgYellow = "\x1b[33m" FgBlue = "\x1b[34m" FgMagenta = "\x1b[35m" FgCyan = "\x1b[36m" FgWhite = "\x1b[37m" FgDefault = "\x1b[39m" FgBlackBright = "\x1b[1;30m" FgRedBright = "\x1b[1;31m" FgGreenBright = "\x1b[1;32m" FgYellowBright = "\x1b[1;33m" FgBlueBright = "\x1b[1;34m" FgMagentaBright = "\x1b[1;35m" FgCyanBright = "\x1b[1;36m" FgWhiteBright = "\x1b[1;37m" )
Text colours.
View Source
var ( BgBlack = "\x1b[40m" BgRed = "\x1b[41m" BgGreen = "\x1b[42m" BgYellow = "\x1b[43m" BgBlue = "\x1b[44m" BgMagenta = "\x1b[45m" BgCyan = "\x1b[46m" BgWhite = "\x1b[47m" BgDefault = "\x1b[49m" BgDarkGray = "\x1b[100m" BgBlueLight = "\x1b[104m" BgBlackBright = "\x1b[1;40m" BgRedBright = "\x1b[1;41m" BgGreenBright = "\x1b[1;42m" BgYellowBright = "\x1b[1;43m" BgBlueBright = "\x1b[1;44m" BgMagentaBright = "\x1b[1;45m" BgCyanBright = "\x1b[1;46m" BgWhiteBright = "\x1b[1;47m" )
Background colours.
Functions ¶
func HasEffects ¶
func HasEffects() bool
HasEffects returns true if colors and effects are supported on the current terminal.
func Trim ¶ added in v1.0.9
Trim accepts a string including arbitrary escaped sequences at arbitrary index positions, and returns the first 'n' printable characters in this string, including all escape codes found between and immediately around those characters (including surrounding 1st and 80th ones).
Types ¶
This section is empty.
Click to show internal directories.
Click to hide internal directories.