term

package
v1.0.3 Latest Latest
Warning

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

Go to latest
Published: Apr 5, 2024 License: MIT Imports: 3 Imported by: 0

Documentation

Index

Constants

View Source
const (
	// Escape character
	ESC = '\x1b'
	// Control Sequence Introducer
	CSI = string(ESC) + "["
)
View Source
const (
	BLACK                = "#0c0c0c"
	RED                  = "#cc0000"
	GREEN                = "#4e9a06"
	YELLOW               = "#c4a000"
	BLUE                 = "#3465a4"
	PURPLE               = "#75507b"
	CYAN                 = "#06989a"
	WHITE                = "#d3d7cf"
	GRAY                 = "#81858d"
	BRIGHT_BLACK         = "#555753"
	BRIGHT_RED           = "#ef2929"
	BRIGHT_GREEN         = "#8ae234"
	BRIGHT_YELLOW        = "#fce94f"
	BRIGHT_BLUE          = "#729fcf"
	BRIGHT_PURPLE        = "#ad7fa8"
	BRIGHT_CYAN          = "#34e2e2"
	BRIGHT_WHITE         = "#eeeeec"
	BACKGROUND           = "#0c0c0c"
	BACKGROUND_ODD       = "#1c1c1c"
	FOREGROUND           = "#eeeeec"
	CURSOR               = "#bbbbbb"
	SELECTION_BACKGROUND = "#b5d5ff"
)
View Source
const (
	ResetSeq = "0"
)

Variables

View Source
var TEXT_STYLE = NewStyle(WHITE, "", false)
View Source
var TEXT_STYLE_ODD = NewStyle(GRAY, "", false)

Functions

func Run

func Run(m Model)

Types

type Color

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

func Hex

func Hex(scol string) Color

type Grid

type Grid struct {
	Rows []GridRow
}

func (Grid) String

func (g Grid) String() string

type GridCell

type GridCell struct {
	Style Style
	Width int
	Text  string
	Align int
	Plain bool
}

type GridRow

type GridRow struct {
	Cells   []GridCell
	Padding int
}

func (GridRow) String

func (r GridRow) String() string

type Model

type Model interface {
	View(m Model) string
}

type Style

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

func NewStyle

func NewStyle(f, b string, bld bool) Style

func (Style) Convert

func (s Style) Convert(t string) string

func (Style) Debug

func (s Style) Debug() string

Jump to

Keyboard shortcuts

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