Documentation
¶
Index ¶
- Constants
- Variables
- func ASCIIString(ch rune) string
- func PlaceholderSymbol(at geom.Point) string
- type Buffer
- func (b *Buffer) Blit(src *Buffer, at geom.Point)
- func (b *Buffer) Clear()
- func (b *Buffer) Fill(style Style)
- func (b *Buffer) FillRange(p geom.Point, width int, style Style)
- func (b *Buffer) Get(p geom.Point) Cell
- func (b *Buffer) PatchBg(p geom.Point, bg Color)
- func (b *Buffer) PatchBgRange(p geom.Point, width int, bg Color)
- func (b *Buffer) RenderToANSI() string
- func (b *Buffer) Set(p geom.Point, c Cell)
- func (b *Buffer) SetRightAlignedInt(args RightAlignedIntArgs)
- func (b *Buffer) SetString(p geom.Point, s string, style Style)
- type Cell
- type Color
- type Modifier
- type RightAlignedIntArgs
- type Style
- func (s Style) Bg(c Color) Style
- func (s Style) BgColor() Color
- func (s Style) Darkened(pct int) Style
- func (s Style) Fg(c Color) Style
- func (s Style) FgColor() Color
- func (s Style) HasMod(m Modifier) bool
- func (s Style) Mod(m Modifier) Style
- func (s Style) Modifier() Modifier
- func (s Style) Quantized() Style
- func (s Style) UlColor(c Color) Style
- func (s Style) UlStyle(u UnderlineStyle) Style
- func (s Style) UnderlineColor() Color
- func (s Style) UnderlineStyle() UnderlineStyle
- type UnderlineStyle
Constants ¶
const ( BorderH = "\u2500" // '─' - box drawings light horizontal BorderV = "\u2502" // '│' - box drawings light vertical BorderTL = "\u256d" // '╭' - box drawings light arc down and right BorderTR = "\u256e" // '╮' - box drawings light arc down and left BorderBL = "\u2570" // '╰' - box drawings light arc up and right BorderBR = "\u256f" // '╯' - box drawings light arc up and left BorderML = "\u251c" // '├' - box drawings light vertical and right BorderMR = "\u2524" // '┤' - box drawings light vertical and left BorderMT = "\u252c" // '┬' - box drawings light down and horizontal BorderMB = "\u2534" // '┴' - box drawings light up and horizontal BorderX = "\u253c" // '┼' - box drawings light cross )
Box-drawing glyphs for panes, popups and any other framed content
const PlaceholderRune = kitty.Placeholder
PlaceholderRune is kitty's Unicode image placeholder
Variables ¶
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 ASCIIString ¶ added in v0.2.0
ASCIIString returns a single-character string for ch without allocating. ch must be printable ASCII: 0x20 (space) through 0x7e (tilde)
func PlaceholderSymbol ¶
PlaceholderSymbol builds the cell content for image row and column
Types ¶
type Buffer ¶
func (*Buffer) FillRange ¶
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) PatchBg ¶
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 ¶
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 ¶
RenderToANSI serializes the buffer as rows joined by '\n', emitting style escapes only on changes, used to bridge into the string-based render path
func (*Buffer) SetRightAlignedInt ¶
func (b *Buffer) SetRightAlignedInt(args RightAlignedIntArgs)
SetRightAlignedInt writes Value as decimal digits right-aligned in a field of Width starting at At, padding left with spaces
type Color ¶
type Color struct {
// contains filtered or unexported fields
}
func ColorIndexed ¶
ColorIndexed returns a color naming a 256-color palette entry
func ImageColor ¶
ImageColor encodes a 24-bit image id as a terminal color
func (Color) Darkened ¶ added in v0.1.15
Darkened scales the color toward black by pct/100 (pct<100 darkens). Reset stays reset; named and indexed colors resolve to rgb first
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 RightAlignedIntArgs ¶ added in v0.2.0
RightAlignedIntArgs is a number and the field it is right-aligned within
type Style ¶
type Style struct {
// contains filtered or unexported fields
}
func (Style) Darkened ¶ added in v0.1.15
Darkened darkens the foreground, background, and underline colors so an unfocused pane recedes
func (Style) Quantized ¶ added in v0.1.35
Quantized snaps the foreground, background, and underline colors onto the 256-color palette
func (Style) UlStyle ¶
func (s Style) UlStyle(u UnderlineStyle) Style
UlStyle returns a copy with the underline variant set
func (Style) UnderlineColor ¶
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 )