tui

package
v0.1.2 Latest Latest
Warning

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

Go to latest
Published: Jul 23, 2026 License: MIT Imports: 5 Imported by: 0

Documentation

Index

Constants

View Source
const PlaceholderRune = kitty.Placeholder

PlaceholderRune is kitty's Unicode image placeholder

Variables

View Source
var (
	ColorReset        = Color{/* contains filtered or unexported fields */}
	ColorBlack        = Color{/* contains filtered or unexported fields */}
	ColorRed          = Color{/* contains filtered or unexported fields */}
	ColorGreen        = Color{/* contains filtered or unexported fields */}
	ColorYellow       = Color{/* contains filtered or unexported fields */}
	ColorBlue         = Color{/* contains filtered or unexported fields */}
	ColorMagenta      = Color{/* contains filtered or unexported fields */}
	ColorCyan         = Color{/* contains filtered or unexported fields */}
	ColorGray         = Color{/* contains filtered or unexported fields */}
	ColorLightRed     = Color{/* contains filtered or unexported fields */}
	ColorLightGreen   = Color{/* contains filtered or unexported fields */}
	ColorLightYellow  = Color{/* contains filtered or unexported fields */}
	ColorLightBlue    = Color{/* contains filtered or unexported fields */}
	ColorLightMagenta = Color{/* contains filtered or unexported fields */}
	ColorLightCyan    = Color{/* contains filtered or unexported fields */}
	ColorLightGray    = Color{/* contains filtered or unexported fields */}
	ColorWhite        = Color{/* contains filtered or unexported fields */}
)

Functions

func PlaceholderSymbol

func PlaceholderSymbol(at geom.Point) string

PlaceholderSymbol builds the cell content for image row and column

Types

type Buffer

type Buffer struct {
	geom.Size
	// contains filtered or unexported fields
}

func NewBuffer

func NewBuffer(size geom.Size) *Buffer

func (*Buffer) Blit

func (b *Buffer) Blit(src *Buffer, at geom.Point)

Blit copies src's cells into b at offset at, clipped to b's bounds

func (*Buffer) Clear

func (b *Buffer) Clear()

func (*Buffer) Fill

func (b *Buffer) Fill(style Style)

Fill sets every cell in the buffer to a space with the given style

func (*Buffer) FillRange

func (b *Buffer) FillRange(p geom.Point, width int, style Style)

FillRange fills width cells with a space in the given style. A style with no background is transparent: each cell keeps its existing background so a pre-painted layer (ruler, cursorline) shows through

func (*Buffer) Get

func (b *Buffer) Get(p geom.Point) Cell

func (*Buffer) PatchBg

func (b *Buffer) PatchBg(p geom.Point, bg Color)

PatchBg sets only the background color of the cell at p, preserving its symbol and foreground. Used to overlay rulers behind already-rendered text

func (*Buffer) PatchBgRange

func (b *Buffer) PatchBgRange(p geom.Point, width int, bg Color)

PatchBgRange sets only the background color of width cells starting at p, preserving each cell's symbol and foreground. Used to overlay a row highlight behind already-rendered text

func (*Buffer) RenderToANSI

func (b *Buffer) RenderToANSI() string

RenderToANSI serialises the buffer as rows joined by '\n', emitting style escapes only on changes — used to bridge into the string-based render path

func (*Buffer) Set

func (b *Buffer) Set(p geom.Point, c Cell)

func (*Buffer) SetRightAlignedInt

func (b *Buffer) SetRightAlignedInt(
	p geom.Point, width, n int, style Style,
)

SetRightAlignedInt writes n as decimal digits right-aligned in a field of width starting at p, padding left with spaces

func (*Buffer) SetString

func (b *Buffer) SetString(p geom.Point, s string, style Style)

SetString writes graphemes of s starting at p, advancing x by display width. A style with no background is transparent, keeping each cell's existing background

type Cell

type Cell struct {
	Symbol string
	Style  Style
	Skip   bool
}

type Color

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

func ColorIndexed

func ColorIndexed(idx uint8) Color

func ColorRGB

func ColorRGB(r, g, b uint8) Color

func ImageColor

func ImageColor(id uint32) Color

ImageColor encodes a 24-bit image id as a terminal colour

func (Color) IsReset

func (c Color) IsReset() bool

type Modifier

type Modifier uint16
const (
	ModifierBold       Modifier = 0b0000_0000_0001
	ModifierDim        Modifier = 0b0000_0000_0010
	ModifierItalic     Modifier = 0b0000_0000_0100
	ModifierSlowBlink  Modifier = 0b0000_0001_0000
	ModifierRapidBlink Modifier = 0b0000_0010_0000
	ModifierReversed   Modifier = 0b0000_0100_0000
	ModifierHidden     Modifier = 0b0000_1000_0000
	ModifierCrossedOut Modifier = 0b0001_0000_0000
)

type Style

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

func (Style) Bg

func (s Style) Bg(c Color) Style

func (Style) BgColor

func (s Style) BgColor() Color

func (Style) Fg

func (s Style) Fg(c Color) Style

func (Style) FgColor

func (s Style) FgColor() Color

func (Style) HasMod

func (s Style) HasMod(m Modifier) bool

func (Style) Mod

func (s Style) Mod(m Modifier) Style

func (Style) Modifier

func (s Style) Modifier() Modifier

Modifier returns the style modifier bits

func (Style) UlColor

func (s Style) UlColor(c Color) Style

func (Style) UlStyle

func (s Style) UlStyle(u UnderlineStyle) Style

func (Style) UnderlineColor

func (s Style) UnderlineColor() Color

UnderlineColor returns the style underline color

func (Style) UnderlineStyle

func (s Style) UnderlineStyle() UnderlineStyle

UnderlineStyle returns the style underline variant

type UnderlineStyle

type UnderlineStyle uint8
const (
	UnderlineReset UnderlineStyle = iota
	UnderlineLine
	UnderlineCurl
	UnderlineDotted
	UnderlineDashed
	UnderlineDoubleLine
)

Jump to

Keyboard shortcuts

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