Documentation ¶
Index ¶
- Constants
- func B(color int) string
- func Color(color int, str string) string
- func ColorStr(color int, format string, args ...interface{}) string
- func E() string
- func IsCygwinTerminal(fd uintptr) bool
- func IsTerminal(fd uintptr) bool
- func NewColorable(file *os.File) io.Writer
- func NewColorableStderr() io.Writer
- func NewColorableStdout() io.Writer
- func NewNonColorable(w io.Writer) io.Writer
- type NonColorable
Constants ¶
View Source
const ( Black = iota + 30 Red Green Yellow Blue Magenta Cyan White )
字体颜色
View Source
const ( HiBlack = iota + 90 HiRed HiGreen HiYellow HiBlue HiMagenta HiCyan HiWhite )
高亮颜色
View Source
const ( BgBlack = iota + 40 BgRed BgGreen BgYellow BgBlue BgMagenta BgCyan BgWhite )
背景色
View Source
const ( BgHiBlack = iota + 100 BgHiRed BgHiGreen BgHiYellow BgHiBlue BgHiMagenta BgHiCyan BgHiWhite )
背景高亮色
View Source
const (
Reset = iota
)
Variables ¶
This section is empty.
Functions ¶
func IsCygwinTerminal ¶
IsCygwinTerminal() return true if the file descriptor is a cygwin or msys2 terminal. This is also always false on this environment.
func IsTerminal ¶
IsTerminal return true if the file descriptor is terminal.
func NewColorable ¶
NewColorable return new instance of Writer which handle escape sequence.
func NewColorableStderr ¶
NewColorableStderr return new instance of Writer which handle escape sequence for stderr.
func NewColorableStdout ¶
NewColorableStdout return new instance of Writer which handle escape sequence for stdout.
Types ¶
type NonColorable ¶
type NonColorable struct {
// contains filtered or unexported fields
}
NonColorable hold writer but remove escape sequence.
Source Files ¶
Click to show internal directories.
Click to hide internal directories.