token

package
v3.1.10 Latest Latest
Warning

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

Go to latest
Published: Feb 26, 2024 License: MIT Imports: 4 Imported by: 0

Documentation

Index

Constants

View Source
const (
	KindEmpty Kind = iota
	KindText
	KindColor
	KindNotColor

	ColorTypeReset       ColorType = iota // \x1b[0m 指定をリセット
	ColorTypeBold                         // \x1b[1m 太字
	ColorTypeDim                          // \x1b[2m 薄く表示
	ColorTypeItalic                       // \x1b[3m イタリック
	ColorTypeUnderline                    // \x1b[4m アンダーライン
	ColorTypeBlink                        // \x1b[5m ブリンク
	ColorTypeSpeedyBlink                  // \x1b[6m 高速ブリンク
	ColorTypeReverse                      // \x1b[7m 文字色と背景色の反転
	ColorTypeHide                         // \x1b[8m 表示を隠す
	ColorTypeDelete                       // \x1b[9m 取り消し
	ColorTypeForeground
	ColorTypeBackground
	ColorTypeResetForeground
	ColorTypeResetBackground
)

Variables

This section is empty.

Functions

This section is empty.

Types

type ColorType

type ColorType int

type Kind

type Kind int

type Token

type Token struct {
	Kind      Kind
	ColorType ColorType
	Color     color.RGBA
	Text      string
}

func NewExtendedColor

func NewExtendedColor(text string) Token

func NewResetBackgroundColor added in v3.1.6

func NewResetBackgroundColor() Token

func NewResetColor

func NewResetColor() Token

func NewResetForegroundColor added in v3.1.6

func NewResetForegroundColor() Token

func NewReverseColor

func NewReverseColor() Token

func NewStandardColorWithCategory

func NewStandardColorWithCategory(text string) Token

func NewText

func NewText(text string) Token

type Tokens

type Tokens []Token

func (*Tokens) MaxStringWidth

func (t *Tokens) MaxStringWidth() int

func (*Tokens) StringLines

func (t *Tokens) StringLines() []string

Jump to

Keyboard shortcuts

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