Documentation ¶
Overview ¶
Package ansi implements ANSI escape codes for terminal colors.
Index ¶
Constants ¶
This section is empty.
Variables ¶
Functions ¶
func Colorf ¶
func Colorf(value interface{}, codes ...Code) interface{}
Colorf returns an fmt.Formatter that colors the value according to the codes when passed to an fmt "printf" function. For example: fmt.Printf("%d %s", Colorf(42, Blue), Colorf(err, Red)). If codes is empty, Colorf returns the original value for efficiency.
Types ¶
Click to show internal directories.
Click to hide internal directories.