Documentation
¶
Overview ¶
ct package provides functions to change the color of console text.
Under windows platform, the Console API is used. Under other systems, ANSI text mode is used.
Index ¶
- Constants
- func Background(writer io.Writer, cl Color, bright bool)
- func ChangeColor(writer io.Writer, fg Color, fgBright bool, bg Color, bgBright bool)
- func ChangeStyle(writer io.Writer, styles ...Style)
- func Foreground(writer io.Writer, cl Color, bright bool)
- func Reset(writer io.Writer)
- type Color
- type Style
Constants ¶
View Source
const ( // No change of color None = Color(iota) Black Red Green Yellow Blue Magenta Cyan White )
Variables ¶
This section is empty.
Functions ¶
func Background ¶
Background changes the background color.
func ChangeColor ¶
ChangeColor sets the foreground and background colors. If the value of the color is None, the corresponding color keeps unchanged. If fgBright or bgBright is set true, corresponding color use bright color. bgBright may be ignored in some OS environment.
func ChangeStyle ¶
ChangeStyle changes the style of printed text
func Foreground ¶
Foreground changes the foreground color.
Types ¶
Click to show internal directories.
Click to hide internal directories.