style

package
v0.35.1 Latest Latest
Warning

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

Go to latest
Published: Jun 15, 2026 License: MIT Imports: 6 Imported by: 0

Documentation

Overview

Package style renders devrig's terminal output: colors, glyphs, and boxes that degrade gracefully. Color is used only on a capable TTY (respecting NO_COLOR / FORCE_COLOR / TERM=dumb, and enabling VT processing on Windows), and Unicode box/▮ glyphs fall back to ASCII where they may not render.

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func Blue

func Blue(s string) string

func Bold

func Bold(s string) string

func BoldCyan

func BoldCyan(s string) string

func BoldMagenta

func BoldMagenta(s string) string

func Box

func Box(title string, rows []string) string

Box renders rows inside a rounded, titled border, indented two spaces. Rows may contain color escapes; widths are measured visibly so borders align. Falls back to ASCII corners when Unicode is unavailable.

func ColorEnabled

func ColorEnabled() bool

ColorEnabled reports whether ANSI color is active.

func Cyan

func Cyan(s string) string

func Dim

func Dim(s string) string

func Gray

func Gray(s string) string

func Green

func Green(s string) string
func Link(url string) string

Link renders a URL, using an OSC 8 hyperlink on capable terminals so it's clickable, and underlined cyan otherwise.

func Magenta

func Magenta(s string) string

func PadRight

func PadRight(s string, n int) string

PadRight pads s with spaces to a visible width of n.

func Red

func Red(s string) string

func Width

func Width(s string) int

Width returns the visible (printable) width of s, ignoring ANSI escapes.

func Yellow

func Yellow(s string) string

Types

type Glyphs

type Glyphs struct {
	TopLeft, TopRight, BotLeft, BotRight, H, V string
	Bullet, MidDot, Arrow                      string
	Running, Pending, Failed, Stopped          string
}

Glyphs is the active glyph set (Unicode or ASCII fallback).

func G

func G() Glyphs

G returns the active glyph set.

Jump to

Keyboard shortcuts

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