color

package
v0.0.0-...-43a95db Latest Latest
Warning

This package is not in the latest version of its module.

Go to latest
Published: Oct 29, 2021 License: MIT Imports: 4 Imported by: 0

Documentation

Index

Constants

View Source
const (
	None = Color(iota)
	Black
	Red
	Green
	Yellow
	Blue
	Magenta
	Cyan
	White
)

Variables

View Source
var Writer io.Writer = os.Stdout

Writer is the io.Writer where ANSI escape codes will be written to

Functions

func Background

func Background(cl Color, bright bool)

Background changes the background color.

func ChangeColor

func ChangeColor(fg Color, fgBright bool, bg Color, bgBright bool)

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

func Foreground(cl Color, bright bool)

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.

Jump to

Keyboard shortcuts

? : This menu
/ : Search site
f or F : Jump to
y or Y : Canonical URL