color

package
v0.5.0 Latest Latest
Warning

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

Go to latest
Published: Aug 22, 2021 License: Apache-2.0 Imports: 2 Imported by: 4

Documentation

Index

Constants

This section is empty.

Variables

View Source
var (
	DefaultFG    = escape.Sequence{Pre: "39", Post: ""} // DefaultFG resets the foreground color
	DefaultBG    = escape.Sequence{Pre: "49", Post: ""} // DefaultBG resets the background color
	Black        = Color{0}
	Red          = Color{1}
	Green        = Color{2}
	Yellow       = Color{3}
	Blue         = Color{4}
	Magenta      = Color{5}
	Cyan         = Color{6}
	LightGray    = Color{7}
	DarkGray     = Color{8}
	LightRed     = Color{9}
	LightGreen   = Color{10}
	LightYellow  = Color{11}
	LightBlue    = Color{12}
	LightMagenta = Color{13}
	LightCyan    = Color{14}
	White        = Color{15}
)

CSI Character Attributes (SGR) - Colors See: https://invisible-island.net/xterm/ctlseqs/ctlseqs.html

Functions

This section is empty.

Types

type Color

type Color struct {
	Code uint8
}

Color represents a 256 color mode sequence

func (Color) BG

func (c Color) BG() escape.Sequence

BG generates an escape Sequence which will set this color as the Background

func (Color) FG

func (c Color) FG() escape.Sequence

FG generates an escape Sequence which will set this color as the Foreground

Jump to

Keyboard shortcuts

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