style

package
v0.0.62 Latest Latest
Warning

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

Go to latest
Published: Apr 13, 2024 License: GPL-3.0 Imports: 5 Imported by: 0

Documentation

Index

Constants

View Source
const COLOR_OFF = "\x1b[0m"
View Source
const KEY_STYLE_COLOR = 1
View Source
const KEY_STYLE_NAME = 0
View Source
const KEY_STYLE_OPTION = 2

Variables

View Source
var (
	DEFAULT_STYLES []string = []string{
		"key          15874B 1",
		"val          FFDD60 1",
		"appTitle     FFFFFF,346488 1",
		"appSep       FFDD60,346488 1",
		"appSubTitle  FFBD99,346488 1",
		"action       885E8E 1",
		"actionSep    FFBD43 3",
		"param        FFE07E 1",
		"context      FFFFFF,A92C58 1",
		"sep          A4A4A4",
		"ok           FFFFFF,06926D 1",
		"ko           FFFFFF,920623 1",
		"usageApp     FFFFFF 1",
		"usageCmd     FFA648 1",
		"usageSection FFE772 1,3",
		"usageArg     15874B 1",
		"usageSep     A678CF 1",
		"usageCom     CFA6DA 3",
		"usageCmd     F18847 1",
		"progress     106573 1",
		"progressTick FFC256 1",
		"progressBg   1D5058 1",
	}
)

Functions

This section is empty.

Types

type Style

type Style struct {
	Name string
	// contains filtered or unexported fields
}

func NewStyleByDef

func NewStyleByDef(def string) *Style

func (*Style) Apply

func (s *Style) Apply(data string) string

func (*Style) Applyf

func (s *Style) Applyf(format string, a ...any) string

func (*Style) Echo

func (s *Style) Echo(data string)

func (*Style) Echof

func (s *Style) Echof(format string, a ...any)

func (*Style) Ln

func (s *Style) Ln()

type Styles

type Styles struct {
	List              map[string]*Style
	DefaultKeyStyle   string
	DefaultValStyle   string
	DefaultKeyPadding string
	DefaultIndent     string
}

func NewStyles

func NewStyles() *Styles

func (*Styles) Apply

func (s *Styles) Apply(name string, data string) string

func (*Styles) Applyf

func (s *Styles) Applyf(name string, format string, a ...any) string

func (*Styles) Echo

func (s *Styles) Echo(name string, data string)

func (*Styles) Echof

func (s *Styles) Echof(name string, format string, a ...any)

func (*Styles) Get

func (s *Styles) Get(name string) *Style

func (*Styles) HasStyle added in v0.0.4

func (s *Styles) HasStyle(name string) bool

func (*Styles) Keyval

func (s *Styles) Keyval(key string, val string, names ...string)

func (*Styles) LoadDefaultStyle added in v0.0.49

func (s *Styles) LoadDefaultStyle()

func (*Styles) Render added in v0.0.9

func (s *Styles) Render()

Jump to

Keyboard shortcuts

? : This menu
/ : Search site
f or F : Jump to
y or Y : Canonical URL