colors

package
v0.5.0 Latest Latest
Warning

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

Go to latest
Published: Feb 20, 2021 License: Apache-2.0 Imports: 5 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

View Source
var Codes = map[string]int{
	"None":         49,
	"Black":        40,
	"Red":          41,
	"Green":        42,
	"Yellow":       43,
	"Blue":         44,
	"Magenta":      45,
	"Cyan":         46,
	"LightGray":    47,
	"DarkGray":     100,
	"LightRed":     101,
	"LightGreen":   102,
	"LightYellow":  103,
	"LightBlue":    104,
	"LightMagenta": 105,
	"LightCyan":    106,
	"White":        107,
}

Codes maps the name of a color to its escape code equivalent

View Source
var Names = []string{
	"None",
	"Black",
	"DarkGray",
	"LightGray",
	"White",
	"Blue",
	"LightBlue",
	"Cyan",
	"LightCyan",
	"Yellow",
	"LightYellow",
	"Green",
	"LightGreen",
	"Magenta",
	"LightMagenta",
	"Red",
	"LightRed",
}

Names is a list of the supported colors

Functions

func Color

func Color(config, name string) (code int)

Color gets the color code from a color config

func Print

func Print()

Print deomonstrates all of the available colors on stdout

func Save

func Save() bool

Save writes out color configs to disk

func Set

func Set(config, name, color string) bool

Set sets the color in a config

Types

type Config

type Config map[string]string

Config created associations between strings and color names

Jump to

Keyboard shortcuts

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