Documentation
¶
Overview ¶
Package pintor colorizes text printed to a terminal. It applies format to the output using ANSI escape sequences.
Index ¶
Constants ¶
const ( Default = 0 Black = 1 << iota Red Green Yellow Blue Magenta Cyan White Bold Italic Underline )
Values that can be used to create a Formatter object.
Default leaves the current format as it is. Eight colors supported: Black, Red, Green, Yellow, Blue, Magenta, Cyan and White. Colors apply for foreground and background color. Modifiers supported: Bold, Italic and Underline.
Variables ¶
This section is empty.
Functions ¶
This section is empty.
Types ¶
type Formatter ¶
type Formatter struct {
// contains filtered or unexported fields
}
Formatter formats the text output.
func NewFormatter ¶
NewFormatter returns a new Formatter that can apply the colors and modifiers specified as parameters. Predefined bits control the colors and modifiers. Look at the package constant to get the colors and modifiers names. Only accepts one color for foreground and one color for background. To apply multiple modifiers at once set the modifiers parameter to:
Bold|Italic
This for example will apply both Bold and Italic to the text.