color

package
v0.2.1 Latest Latest
Warning

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

Go to latest
Published: Sep 28, 2023 License: MIT Imports: 3 Imported by: 0

Documentation

Index

Constants

View Source
const Escape = "\x1b"

Variables

This section is empty.

Functions

func Blue

func Blue() string

func ByName

func ByName(name string) string

func ByNames

func ByNames(name ...string) string

func Clear

func Clear() string

func Cyan

func Cyan() string

func Green

func Green() string

func Magenta

func Magenta() string

func Red

func Red() string

func Yellow

func Yellow() string

Types

type Parameter

type Parameter uint8

Parameter defines an SGR parameter. See: https://en.wikipedia.org/wiki/ANSI_escape_code#SGR_parameters

const (
	Reset Parameter = iota
	Bold
	Faint
	Italic
	Underline
	BlinkSlow
	BlinkRapid
	ReverseVideo
	Conceal
	CrossedOut
	PrimaryFont
)

Base params.

const (
	FgBlack Parameter = iota + 30
	FgRed
	FgGreen
	FgYellow
	FgBlue
	FgMagenta
	FgCyan
	FgWhite
)

Foreground.

const (
	FgBBlack Parameter = iota + 90
	FgBRed
	FgBGreen
	FgBYellow
	FgBBlue
	FgBMagenta
	FgBCyan
	FgBWhite
)

Foreground Bright.

const (
	BgBlack Parameter = iota + 40
	BgRed
	BgGreen
	BgYellow
	BgBlue
	BgMagenta
	BgCyan
	BgWhite
)

Background.

const (
	BgBBlack Parameter = iota + 100
	BgBRed
	BgBGreen
	BgBYellow
	BgBBlue
	BgBMagenta
	BgBCyan
	BgBWhite
)

Background Bright.

func NewParameter

func NewParameter(name string) Parameter

NewParameter returns a Parameter based on the given name. If the name doesn't match any value, the zero-value is returned.

func (Parameter) String

func (c Parameter) String() string

String implements the fmt.Stringer interface.

Jump to

Keyboard shortcuts

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