internal

package
v1.4.0 Latest Latest
Warning

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

Go to latest
Published: Jun 24, 2021 License: MIT Imports: 4 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

View Source
var CustomMap = map[string]func(string) string{}

CustomMap is the custom styles map

View Source
var Map = map[string]color.Color{
	"red":          color.Red,
	"cyan":         color.Cyan,
	"gray":         color.Gray,
	"blue":         color.Blue,
	"black":        color.Black,
	"green":        color.Green,
	"white":        color.White,
	"yellow":       color.Yellow,
	"magenta":      color.Magenta,
	"lightRed":     color.LightRed,
	"lightCyan":    color.LightCyan,
	"lightBlue":    color.LightBlue,
	"lightGreen":   color.LightGreen,
	"lightWhite":   color.LightWhite,
	"lightYellow":  color.LightYellow,
	"lightMagenta": color.LightMagenta,

	"bgRed":          color.BgRed,
	"bgGray":         color.BgGray,
	"bgCyan":         color.BgCyan,
	"bgBlue":         color.BgBlue,
	"bgWhite":        color.BgWhite,
	"bgBlack":        color.BgBlack,
	"bgGreen":        color.BgGreen,
	"bgYellow":       color.BgYellow,
	"bgMagenta":      color.BgMagenta,
	"bgDefault":      color.BgDefault,
	"bgDarkGray":     color.BgDarkGray,
	"bgLightRed":     color.BgLightRed,
	"bgLightCyan":    color.BgLightCyan,
	"bgLightBlue":    color.BgLightBlue,
	"bgLightWhite":   color.BgLightWhite,
	"bgLightGreen":   color.BgLightGreen,
	"bgLightYellow":  color.BgLightYellow,
	"bgLightMagenta": color.BgLightMagenta,

	"bold":      color.Bold,
	"italic":    color.OpItalic,
	"crossout":  color.OpStrikethrough,
	"underline": color.OpUnderscore,
	"blink":     color.OpBlink,
	"reverse":   color.OpReverse,
	"concealed": color.OpConcealed,
}

Map is the styles map

Functions

func ParseAndApply added in v1.1.0

func ParseAndApply(text string, disable bool) string

ParseAndApply parses the passed format string and applies styles, returning a styled string.

func StyleBuilder added in v1.0.2

func StyleBuilder(styles []string, text string, disable bool) (string, error)

StyleBuilder is a function that returns a styled string based on the supplied style.

Types

This section is empty.

Jump to

Keyboard shortcuts

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