Documentation ¶
Index ¶
- Variables
- func TemplateFuncMapAddColors(m template.FuncMap) template.FuncMap
- type Color
- type Decoration
- type Sprinter
- type TextStyle
- func (b TextStyle) MergeStyle(other TextStyle) TextStyle
- func (b TextStyle) SetBg(color Color) TextStyle
- func (b TextStyle) SetBold() TextStyle
- func (b TextStyle) SetFg(color Color) TextStyle
- func (b TextStyle) SetReverse() TextStyle
- func (b TextStyle) SetUnderline() TextStyle
- func (b TextStyle) Sprint(a ...interface{}) string
- func (b TextStyle) Sprintf(format string, a ...interface{}) string
Constants ¶
This section is empty.
Variables ¶
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}, } )
Functions ¶
Types ¶
type Color ¶
type Color struct {
// contains filtered or unexported fields
}
func NewBasicColor ¶
func NewRGBColor ¶
type Decoration ¶
type Decoration struct {
// contains filtered or unexported fields
}
func (Decoration) Merge ¶
func (d Decoration) Merge(other Decoration) Decoration
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 TextStyle ¶
type TextStyle struct {
// contains filtered or unexported fields
}
func FromBasicBg ¶
func FromBasicFg ¶
func (TextStyle) MergeStyle ¶
func (TextStyle) SetBold ¶
note that our receiver here is not a pointer which means we're receiving a copy of the original TextStyle. This allows us to mutate and return that TextStyle receiver without actually modifying the original.
func (TextStyle) SetReverse ¶
func (TextStyle) SetUnderline ¶
Click to show internal directories.
Click to hide internal directories.