pretty

package module
v0.0.6-17 Latest Latest
Warning

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

Go to latest
Published: Jan 9, 2026 License: MIT Imports: 3 Imported by: 1

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type ANSI256

type ANSI256 uint8

type Align

type Align int
const (
	AlignLeft Align = iota
	AlignCenter
	AlignRight
)

type Basic

type Basic BasicColor

type BasicColor

type BasicColor int
const (
	Black BasicColor = iota
	Red
	Green
	Yellow
	Blue
	Magenta
	Cyan
	White
	BrightBlack
	BrightRed
	BrightGreen
	BrightYellow
	BrightBlue
	BrightMagenta
	BrightCyan
	BrightWhite
)

type Border

type Border struct {
	Chars BorderChars
	Style BorderStyle
}

type BorderChars

type BorderChars struct {
	Horizontal  rune
	Vertical    rune
	TopLeft     rune
	TopRight    rune
	BottomLeft  rune
	BottomRight rune
}

type BorderStyle

type BorderStyle struct {
	Color  Color
	Bold   bool
	Italic bool
}

func (BorderStyle) Base

func (s BorderStyle) Base() Style

type Box

type Box struct {
	Width    int
	SizeMode SizeMode
	MinWidth int
	PaddingX int
	PaddingY int
	MarginX  int
	MarginY  int
	Style    BoxStyle
	Border   Border
	Segments []Segment
}

func NewAutoBox

func NewAutoBox() *Box

func NewBox

func NewBox(width int) *Box

func (*Box) AddSegment

func (box *Box) AddSegment(s Segment)

func (*Box) Render

func (box *Box) Render() string

type BoxStyle

type BoxStyle struct {
	Background Color
	Border     BorderStyle
}

func (BoxStyle) Base

func (s BoxStyle) Base() Style

type Color

type Color interface {
	// contains filtered or unexported methods
}

type RGB

type RGB struct {
	R, G, B uint8
}

func RGBColor

func RGBColor(r, g, b uint8) RGB

type Segment

type Segment struct {
	Text  string
	Align Align
	Style Style
}

type SizeMode

type SizeMode int
const (
	FixedWidth SizeMode = iota
	AutoWidth
)

type Style

type Style struct {
	Foreground Color
	Background Color
	Bold       bool
	Italic     bool
}

func (Style) Combine

func (s1 Style) Combine(s2 Style) Style

Jump to

Keyboard shortcuts

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