package ct
import "github.com/daviddengcn/go-colortext"
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
- Variables
- func Background(cl Color, bright bool)
- func ChangeColor(fg Color, fgBright bool, bg Color, bgBright bool)
- func Foreground(cl Color, bright bool)
- func ResetColor()
- type Color
Constants ¶
Variables ¶
Writer is the io.Writer where ANSI escape codes will be written to
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 Foreground ¶
Foreground changes the foreground color.
func ResetColor ¶
func ResetColor()
ResetColor resets the foreground and background to original colors
Types ¶
type Color ¶
type Color int
Color is the type of color to be set.
Source Files ¶
Directories ¶
Path | Synopsis |
---|---|
fmt | Package ctfmt is a handful wrapping of go-colortext (ct) package and fmt package. |
- Version
- v1.0.0 (latest)
- Published
- Mar 29, 2020
- Platform
- js/wasm
- Imports
- 4 packages
- Last checked
- 1 month ago –
Tools for package owners.