Version: v0.0.0-...-e3d619f Latest Latest

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

Go to latest
Published: Sep 27, 2021 License: MIT Imports: 1 Imported by: 0




This section is empty.


View Source
var (
	FgWhite        = FromBasicFg(color.FgWhite)
	FgLightWhite   = FromBasicFg(color.FgLightWhite)
	FgBlack        = FromBasicFg(color.FgBlack)
	FgBlackLighter = FromBasicFg(color.FgBlack.Light())
	FgCyan         = FromBasicFg(color.FgCyan)
	FgRed          = FromBasicFg(color.FgRed)
	FgGreen        = FromBasicFg(color.FgGreen)
	FgBlue         = FromBasicFg(color.FgBlue)
	FgYellow       = FromBasicFg(color.FgYellow)
	FgMagenta      = FromBasicFg(color.FgMagenta)

	BgWhite   = FromBasicBg(color.BgWhite)
	BgBlack   = FromBasicBg(color.BgBlack)
	BgRed     = FromBasicBg(color.BgRed)
	BgGreen   = FromBasicBg(color.BgGreen)
	BgYellow  = FromBasicBg(color.BgYellow)
	BgBlue    = FromBasicBg(color.BgBlue)
	BgMagenta = FromBasicBg(color.BgMagenta)
	BgCyan    = FromBasicBg(color.BgCyan)

	AttrUnderline = New().SetUnderline()
	AttrBold      = New().SetBold()

	ColorMap = map[string]struct {
		Foreground TextStyle
		Background TextStyle
		"default": {FgWhite, BgBlack},
		"black":   {FgBlack, BgBlack},
		"red":     {FgRed, BgRed},
		"green":   {FgGreen, BgGreen},
		"yellow":  {FgYellow, BgYellow},
		"blue":    {FgBlue, BgBlue},
		"magenta": {FgMagenta, BgMagenta},
		"cyan":    {FgCyan, BgCyan},
		"white":   {FgWhite, BgWhite},


This section is empty.


type Color

type Color struct {
	// contains filtered or unexported fields

func NewBasicColor

func NewBasicColor(cl color.Basic) Color

type Decoration

type Decoration struct {
	// contains filtered or unexported fields

func (*Decoration) SetBold

func (d *Decoration) SetBold()

func (*Decoration) SetReverse

func (d *Decoration) SetReverse()

func (*Decoration) SetUnderline

func (d *Decoration) SetUnderline()

func (Decoration) ToOpts

func (d Decoration) ToOpts() color.Opts

type Sprinter

type Sprinter interface {
	Sprint(a ...interface{}) string
	Sprintf(format string, a ...interface{}) string

type TextStyle

type TextStyle struct {
	// contains filtered or unexported fields

func FromBasicBg

func FromBasicBg(bg color.Color) TextStyle

func FromBasicFg

func FromBasicFg(fg color.Color) TextStyle

func New

func New() TextStyle

func (TextStyle) SetBg

func (b TextStyle) SetBg(color Color) TextStyle

func (TextStyle) SetBold

func (b TextStyle) SetBold() TextStyle

func (TextStyle) SetFg

func (b TextStyle) SetFg(color Color) TextStyle

func (TextStyle) SetReverse

func (b TextStyle) SetReverse() TextStyle

func (TextStyle) SetUnderline

func (b TextStyle) SetUnderline() TextStyle

func (TextStyle) Sprint

func (b TextStyle) Sprint(a ...interface{}) string

func (TextStyle) Sprintf

func (b TextStyle) Sprintf(format string, a ...interface{}) string

Jump to

Keyboard shortcuts

? : This menu
/ : Search site
f or F : Jump to
t or T : Toggle theme light dark auto
y or Y : Canonical URL