Documentation
¶
Overview ¶
Package term provides terminal I/O, output formatting, and color conventions for the Krewire ecosystem.
Index ¶
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
Types ¶
type Color ¶
type Color int
Color is an ANSI 16-color palette value.
const ( // ColorBlack is ANSI black. ColorBlack Color = 30 // ColorRed is ANSI red. ColorRed Color = 31 // ColorGreen is ANSI green. ColorGreen Color = 32 // ColorYellow is ANSI yellow. ColorYellow Color = 33 // ColorBlue is ANSI blue. ColorBlue Color = 34 // ColorMagenta is ANSI magenta. ColorMagenta Color = 35 // ColorCyan is ANSI cyan. ColorCyan Color = 36 // ColorWhite is ANSI white. ColorWhite Color = 37 // ColorDefault is the terminal default foreground. ColorDefault Color = 39 )
type Terminal ¶
type Terminal struct {
// ColorSupported reports whether ANSI color codes should be emitted.
ColorSupported bool
}
Terminal guards against emitting color codes when the destination does not support them.
func NewTerminal ¶
func NewTerminal() *Terminal
NewTerminal detects color support from the NO_COLOR and TERM environment variables.
Click to show internal directories.
Click to hide internal directories.