Documentation
¶
Overview ¶
Package color makes it easy to output formatted text (via tput or output codes depending on the operating system). tput is preferred when possible as that doesn't modify the text passed to downstream commands See the tput documentation for more info: https://linuxcommand.org/lc3_adv_tput.php This package is specifically implemented to work well with the base `command` package, both in terms of usage and testing.
Index ¶
Constants ¶
This section is empty.
Variables ¶
View Source
var ( Black = &ColorCode{0, true} Red = &ColorCode{1, true} Green = &ColorCode{2, true} Yellow = &ColorCode{3, true} Blue = &ColorCode{4, true} Magenta = &ColorCode{5, true} Cyan = &ColorCode{6, true} White = &ColorCode{7, true} Reset = newEffect(0, "init") Bold = newEffect(1, "bold") Underline = newEffect(4, "smul") EndUnderline = newEffect(24, "rmul") )
Functions ¶
func OutputCode ¶
OutputCode gets the output codes for the provided `Formats`. Note: the callers of this package are responsible for applying the `Reset` format.
Types ¶
type ColorCode ¶
type ColorCode struct {
// contains filtered or unexported fields
}
ColorCode is the color code for tput and for the output format `\033[0;(30+X)m`.
func (*ColorCode) Background ¶
Directories
¶
Path | Synopsis |
---|---|
Package colorreset provides a CLI that clears all color formatting done by the github.com/leep-frog/command/color package.
|
Package colorreset provides a CLI that clears all color formatting done by the github.com/leep-frog/command/color package. |
Click to show internal directories.
Click to hide internal directories.