Documentation ¶
Index ¶
- func Colorize(text string) string
- func ColorizeWithCode(key, text string) string
- func ColorizeWithFallback(text string, fallback bool) string
- func ColorizeWithFallbackCode(key, text string, fallback bool) string
- func Escape(text string) string
- func FallbackColor(code string) string
- func Purge(text string) string
- type ColorizeFunc
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
func Colorize ¶
Colorize processes all colors in a given text block and returns a new string with all readable codes translated to ANSI codes.
func ColorizeWithCode ¶
ColorizeWithCode takes a color code and text string and returns the string with the appropriate color codes in it.
func ColorizeWithFallback ¶
ColorizeWithFallback will replace xterm color choices with their fallback colors if false is passed in place of fallback
func ColorizeWithFallbackCode ¶
ColorizeWithFallbackCode takes a color code and text string and returns the string with the appropriate color codes in it.
func Escape ¶
Escape will replace all ANSI escape codes with text equivalents so strings can be printed with color codes.
func FallbackColor ¶
FallbackColor takes a code for a given xterm value and then returns the best ANSI match for it.
Types ¶
type ColorizeFunc ¶
ColorizeFunc is a function that takes a string and returns a string with ANSI color escape codes in it.