Documentation
¶
Index ¶
- Constants
- Variables
- func Gap(size int) string
- func Length(text string) int
- func Line(text string, length int) string
- func Size(text string) int
- func TerminalHeight() int
- func TerminalSize() (int, int)
- func TerminalWidth() int
- type Align
- type Applier
- type Attributes
- type Border
- type Color
- type Color256
- type ColorDefault
- type ColorHex
- type ColorRGB
- type Padding
- type Style
- func (s Style) Align(align Align) Style
- func (s Style) Apply(args ...string) (output string)
- func (s Style) Bg(color Color) Style
- func (s Style) Bg256(value uint8) Style
- func (s Style) BgHex(value string) Style
- func (s Style) BgRGB(r, g, b uint8) Style
- func (s Style) Blink(enable bool) Style
- func (s Style) Bold(enable bool) Style
- func (s Style) Border(border rune) Style
- func (s Style) BorderLeft(border rune) Style
- func (s Style) BorderRight(border rune) Style
- func (s Style) Crossout(enable bool) Style
- func (s Style) DefaultBg() Style
- func (s Style) DefaultFg() Style
- func (s Style) Dim(enable bool) Style
- func (s Style) Fg(color Color) Style
- func (s Style) Fg256(value uint8) Style
- func (s Style) FgHex(value string) Style
- func (s Style) FgRGB(r, g, b uint8) Style
- func (s Style) GetAlign() Align
- func (s Style) GetAttributes() map[string]bool
- func (s Style) GetBg() Color
- func (s Style) GetBorder() Border
- func (s Style) GetFg() Color
- func (s Style) GetGridGap() int
- func (s Style) GetMargin() Padding
- func (s Style) GetPadding() Padding
- func (s Style) GetTarget() Target
- func (s Style) GetWidth() int
- func (s Style) GridGap(gridGap int) Style
- func (s Style) Invisible(enable bool) Style
- func (s Style) Italic(enable bool) Style
- func (s Style) Margin(size int) Style
- func (s Style) MarginLeft(size int) Style
- func (s Style) MarginRight(size int) Style
- func (s Style) Padding(size int) Style
- func (s Style) PaddingLeft(size int) Style
- func (s Style) PaddingRight(size int) Style
- func (s Style) Reverse(enable bool) Style
- func (s Style) Target(target Target) Style
- func (s Style) Underline(enable bool) Style
- func (s Style) Width(w int) Style
- type Target
Constants ¶
View Source
const ( AutoWidth = 0 NoBorder = rune(0) )
View Source
const ( TargetStdout = Target(iota) TargetStderr TargetTTY TargetOther )
View Source
const ( AlignLeft = Align(iota) AlignRight AlignCenter )
Variables ¶
View Source
var ( Black = NewColor256(ansi.Black) Red = NewColor256(ansi.Red) Green = NewColor256(ansi.Green) Yellow = NewColor256(ansi.Yellow) Blue = NewColor256(ansi.Blue) Magenta = NewColor256(ansi.Magenta) Cyan = NewColor256(ansi.Cyan) White = NewColor256(ansi.White) LightBlack = NewColor256(ansi.LightBlack) LightRed = NewColor256(ansi.LightRed) LightGreen = NewColor256(ansi.LightGreen) LightYellow = NewColor256(ansi.LightYellow) LightBlue = NewColor256(ansi.LightBlue) LightMagenta = NewColor256(ansi.LightMagenta) LightCyan = NewColor256(ansi.LightCyan) LightWhite = NewColor256(ansi.LightWhite) )
View Source
var ( Bold = NewStyle().Bold(true).Apply Dim = NewStyle().Dim(true).Apply Italic = NewStyle().Italic(true).Apply Underline = NewStyle().Underline(true).Apply Blink = NewStyle().Blink(true).Apply Reverse = NewStyle().Reverse(true).Apply Invisible = NewStyle().Invisible(true).Apply Crossout = NewStyle().Crossout(true).Apply BlackFg = NewStyle().Fg(Black).Apply RedFg = NewStyle().Fg(Red).Apply GreenFg = NewStyle().Fg(Green).Apply YellowFg = NewStyle().Fg(Yellow).Apply BlueFg = NewStyle().Fg(Blue).Apply MagentaFg = NewStyle().Fg(Magenta).Apply CyanFg = NewStyle().Fg(Cyan).Apply WhiteFg = NewStyle().Fg(White).Apply BlackBg = NewStyle().Bg(Black).Apply RedBg = NewStyle().Bg(Red).Apply GreenBg = NewStyle().Bg(Green).Apply YellowBg = NewStyle().Bg(Yellow).Apply BlueBg = NewStyle().Bg(Blue).Apply MagentaBg = NewStyle().Bg(Magenta).Apply CyanBg = NewStyle().Bg(Cyan).Apply WhiteBg = NewStyle().Bg(White).Apply LightBlackFg = NewStyle().Fg(LightBlack).Apply LightRedFg = NewStyle().Fg(LightRed).Apply LightGreenFg = NewStyle().Fg(LightGreen).Apply LightYellowFg = NewStyle().Fg(LightYellow).Apply LightBlueFg = NewStyle().Fg(LightBlue).Apply LightMagentaFg = NewStyle().Fg(LightMagenta).Apply LightCyanFg = NewStyle().Fg(LightCyan).Apply LightWhiteFg = NewStyle().Fg(LightWhite).Apply LightBlackBg = NewStyle().Bg(LightBlack).Apply LightRedBg = NewStyle().Bg(LightRed).Apply LightGreenBg = NewStyle().Bg(LightGreen).Apply LightYellowBg = NewStyle().Bg(LightYellow).Apply LightBlueBg = NewStyle().Bg(LightBlue).Apply LightMagentaBg = NewStyle().Bg(LightMagenta).Apply LightCyanBg = NewStyle().Bg(LightCyan).Apply LightWhiteBg = NewStyle().Bg(LightWhite).Apply Center = NewStyle().Width(-1).Align(AlignCenter).Apply Left = NewStyle().Width(-1).Align(AlignLeft).Apply Right = NewStyle().Width(-1).Align(AlignRight).Apply )
Functions ¶
func TerminalHeight ¶
func TerminalHeight() int
func TerminalSize ¶
func TerminalWidth ¶
func TerminalWidth() int
Types ¶
type Attributes ¶
func (Attributes) Blink ¶
func (a Attributes) Blink() bool
func (Attributes) Bold ¶
func (a Attributes) Bold() bool
func (Attributes) Crossout ¶
func (a Attributes) Crossout() bool
func (Attributes) Dim ¶
func (a Attributes) Dim() bool
func (Attributes) Invisible ¶
func (a Attributes) Invisible() bool
func (Attributes) Italic ¶
func (a Attributes) Italic() bool
func (Attributes) Reverse ¶
func (a Attributes) Reverse() bool
func (Attributes) Underline ¶
func (a Attributes) Underline() bool
type ColorDefault ¶
type ColorDefault struct{}
func (ColorDefault) AnsiBg ¶
func (c ColorDefault) AnsiBg() string
func (ColorDefault) AnsiFg ¶
func (c ColorDefault) AnsiFg() string
type Style ¶
type Style struct {
// contains filtered or unexported fields
}
func (Style) BorderLeft ¶
func (Style) BorderRight ¶
func (Style) GetAttributes ¶
func (Style) GetGridGap ¶
func (Style) GetPadding ¶
func (Style) MarginLeft ¶
func (Style) MarginRight ¶
func (Style) PaddingLeft ¶
func (Style) PaddingRight ¶
Click to show internal directories.
Click to hide internal directories.