term

package
v0.0.0-...-041bb18 Latest Latest
Warning

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

Go to latest
Published: Sep 2, 2023 License: MIT Imports: 6 Imported by: 0

Documentation

Index

Constants

View Source
const (
	DefaultTermWidth = 80
)

Variables

View Source
var (
	EmptyBytes = []byte("")
	CsiStart   = []byte("\x1b[")
	CsiEnd     = []byte("m")
	CsiReset   = []byte("\x1b[0m")
)
View Source
var (
	TermWidth = DefaultTermWidth
)

Functions

func Color256ToColor8

func Color256ToColor8(r, g, b uint8) uint8

func Color256ToIndex

func Color256ToIndex(r, g, b uint8) uint8

func GetTermWidth

func GetTermWidth() int

Types

type ConsoleTerm

type ConsoleTerm struct {
	// contains filtered or unexported fields
}

func NewConsoleTerm

func NewConsoleTerm(width int) *ConsoleTerm

func (*ConsoleTerm) CsiReset

func (t *ConsoleTerm) CsiReset() []byte

func (*ConsoleTerm) Width

func (t *ConsoleTerm) Width() int

type DumbTerm

type DumbTerm struct {
}

func NewDumbTerm

func NewDumbTerm() *DumbTerm

func (*DumbTerm) CsiReset

func (*DumbTerm) CsiReset() []byte

func (*DumbTerm) Width

func (*DumbTerm) Width() int

type RenderedColors

type RenderedColors struct {
	// contains filtered or unexported fields
}

func NewRenderedColors

func NewRenderedColors(t Term, c *colors.Colors) *RenderedColors

func (*RenderedColors) BgCode

func (r *RenderedColors) BgCode() []byte

func (*RenderedColors) Colors

func (r *RenderedColors) Colors() *colors.Colors

func (*RenderedColors) FgCode

func (r *RenderedColors) FgCode() []byte

func (*RenderedColors) SetNext

func (r *RenderedColors) SetNext(next *RenderedColors)

func (*RenderedColors) String

func (r *RenderedColors) String() string

type Rgb24Term

type Rgb24Term struct {
	// contains filtered or unexported fields
}

func NewRgb24Term

func NewRgb24Term(width int) *Rgb24Term

func (*Rgb24Term) CsiReset

func (*Rgb24Term) CsiReset() []byte

func (*Rgb24Term) Width

func (t *Rgb24Term) Width() int

type Rgb8Term

type Rgb8Term struct {
	// contains filtered or unexported fields
}

func NewRgb8Term

func NewRgb8Term(width int) *Rgb8Term

func (*Rgb8Term) CsiReset

func (*Rgb8Term) CsiReset() []byte

func (*Rgb8Term) Width

func (t *Rgb8Term) Width() int

type Term

type Term interface {
	Width() int

	CsiReset() []byte
	// contains filtered or unexported methods
}

func NewDefaultTerm

func NewDefaultTerm() Term

Jump to

Keyboard shortcuts

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