style

package
v0.0.0-...-6df7f83 Latest Latest
Warning

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

Go to latest
Published: Oct 4, 2023 License: MIT Imports: 2 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

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

Functions

This section is empty.

Types

type Color

type Color struct {
	// contains filtered or unexported fields
}

func NewBasicColor

func NewBasicColor(cl color.Color) Color

func NewRGBColor

func NewRGBColor(cl color.RGBColor) Color

func (Color) IsRGB

func (c Color) IsRGB() bool

func (Color) ToRGB

func (c Color) ToRGB(isBg bool) Color

type Decoration

type Decoration struct {
	// contains filtered or unexported fields
}

func (*Decoration) SetBold

func (d *Decoration) SetBold()

func (*Decoration) SetItalic

func (d *Decoration) SetItalic()

func (*Decoration) SetReverse

func (d *Decoration) SetReverse()

func (*Decoration) SetUnderscore

func (d *Decoration) SetUnderscore()

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 FromStyleConfig

func FromStyleConfig(styleConfig *config.StyleConfig) 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) SetItalic

func (b TextStyle) SetItalic() TextStyle

func (TextStyle) SetReverse

func (b TextStyle) SetReverse() TextStyle

func (TextStyle) SetUnderscore

func (b TextStyle) SetUnderscore() 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
y or Y : Canonical URL