Documentation
¶
Index ¶
- Variables
- func Blink(t string) string
- func Bold(t string) string
- func ClearScreen()
- func ClearScreenWithBg(c Color)
- func ColorBg(text string, bg Color) string
- func ColorText(text string, fg Color) string
- func Colorize(text string, fg Color, bg Color) string
- func Dim(t string) string
- func Italic(t string) string
- func PrintANSI256Table()
- func PrintLine(line string, fg Color, bg Color)
- func Reset()
- func ResetAll()
- func ResetBg()
- func ResetFg()
- func ResetOutput()
- func ResetScreenBg()
- func ResetStyle() string
- func Reverse(t string) string
- func SetBg(c Color)
- func SetFg(c Color)
- func SetOutput(w io.Writer)
- func Strike(t string) string
- func StripANSI(s string) string
- func Underline(t string) string
- func WithColors(text string, fg Color, bg Color) string
- type Color
- type ColorEntry
- type StyleBuilder
- func (s *StyleBuilder) Bg(c Color) *StyleBuilder
- func (s *StyleBuilder) Blink() *StyleBuilder
- func (s *StyleBuilder) Bold() *StyleBuilder
- func (s *StyleBuilder) Dim() *StyleBuilder
- func (s *StyleBuilder) Fg(c Color) *StyleBuilder
- func (s *StyleBuilder) Italic() *StyleBuilder
- func (s *StyleBuilder) Reverse() *StyleBuilder
- func (s *StyleBuilder) Sprint(text string) string
- func (s *StyleBuilder) Sprintln(text string) string
- func (s *StyleBuilder) Strike() *StyleBuilder
- func (s *StyleBuilder) Underline() *StyleBuilder
Constants ¶
This section is empty.
Variables ¶
View Source
var ColorList = []ColorEntry{ {ColorBlack, "Black"}, {ColorWhite, "White"}, {ColorRed, "Red"}, {ColorCyan, "Cyan"}, {ColorPurple, "Purple"}, {ColorGreen, "Green"}, {ColorBlue, "Blue"}, {ColorYellow, "Yellow"}, {ColorOrange, "Orange"}, {ColorBrown, "Brown"}, {ColorLightRed, "LightRed"}, {ColorDarkGray, "DarkGray"}, {ColorMediumGray, "MediumGray"}, {ColorLightGreen, "LightGreen"}, {ColorLightBlue, "LightBlue"}, {ColorLightGray, "LightGray"}, {ColorLightPurple, "LightPurple"}, {ColorDarkPurple, "DarkPurple"}, {ColorC64BG, "C64BG"}, {ColorC64FG, "C64FG"}, {ColorA800BG, "A800BG"}, {ColorA800FG, "A800FG"}, }
Functions ¶
func ClearScreen ¶
func ClearScreen()
func ClearScreenWithBg ¶
func ClearScreenWithBg(c Color)
ClearScreenWithBg pinta a tela inteira com uma cor VIC-II.
func ResetOutput ¶
func ResetOutput()
Types ¶
type Color ¶
type Color int
const ( ColorBlack Color = iota ColorWhite ColorRed ColorCyan ColorPurple ColorGreen ColorBlue ColorYellow ColorOrange ColorBrown ColorLightRed ColorDarkGray ColorMediumGray ColorLightGreen ColorLightBlue ColorLightGray ColorLightPurple ColorDarkPurple ColorC64BG // NOVA ColorC64FG ColorA800BG // NOVA ColorA800FG )
type ColorEntry ¶
type StyleBuilder ¶
type StyleBuilder struct {
// contains filtered or unexported fields
}
StyleBuilder permite compor estilos (cores + atributos ANSI) de forma fluente.
func NewStyle ¶
func NewStyle() *StyleBuilder
func (*StyleBuilder) Bg ¶
func (s *StyleBuilder) Bg(c Color) *StyleBuilder
Bg define a cor de background.
func (*StyleBuilder) Blink ¶
func (s *StyleBuilder) Blink() *StyleBuilder
func (*StyleBuilder) Bold ¶
func (s *StyleBuilder) Bold() *StyleBuilder
func (*StyleBuilder) Dim ¶
func (s *StyleBuilder) Dim() *StyleBuilder
func (*StyleBuilder) Fg ¶
func (s *StyleBuilder) Fg(c Color) *StyleBuilder
Fg define a cor de foreground (texto).
func (*StyleBuilder) Italic ¶
func (s *StyleBuilder) Italic() *StyleBuilder
func (*StyleBuilder) Reverse ¶
func (s *StyleBuilder) Reverse() *StyleBuilder
func (*StyleBuilder) Sprint ¶
func (s *StyleBuilder) Sprint(text string) string
Sprint aplica o estilo ao texto e retorna ANSI + reset.
func (*StyleBuilder) Sprintln ¶
func (s *StyleBuilder) Sprintln(text string) string
func (*StyleBuilder) Strike ¶
func (s *StyleBuilder) Strike() *StyleBuilder
func (*StyleBuilder) Underline ¶
func (s *StyleBuilder) Underline() *StyleBuilder
Click to show internal directories.
Click to hide internal directories.