prettyutils

package module
v0.0.5 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: 0

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 Box

type Box struct {
	Width       int
	SizeMode    SizeMode
	MinWidth    int
	PaddingX    int
	PaddingY    int
	BorderStyle Style
	Segments    []Segment
}

func NewAutoBox added in v0.0.4

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 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 added in v0.0.4

type SizeMode int
const (
	FixedWidth SizeMode = iota
	AutoWidth
)

type Style

type Style struct {
	Fg     Color
	Bold   bool
	Italic bool
}

Jump to

Keyboard shortcuts

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