ui

package
v0.3.0 Latest Latest
Warning

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

Go to latest
Published: Jul 8, 2026 License: MIT Imports: 4 Imported by: 0

Documentation

Overview

Package ui renders tforg's terminal output: the color palette and unified diffs.

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func PrintDiff

func PrintDiff(pal Palette, relPath string, a, b []byte)

PrintDiff writes a colorized unified diff to stdout.

Types

type Palette

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

func NewPalette

func NewPalette(disable bool) Palette

NewPalette decides whether to emit color: an explicit flag or the NO_COLOR convention wins, CLICOLOR_FORCE overrides the TTY check (useful when a hook runner captures output), otherwise color only when stdout is a terminal.

func (Palette) Bold

func (p Palette) Bold(s string) string

func (Palette) Dim

func (p Palette) Dim(s string) string

func (Palette) File

func (p Palette) File(name string) string

func (Palette) Green

func (p Palette) Green(s string) string

func (Palette) Paint

func (p Palette) Paint(code, s string) string

func (Palette) Red

func (p Palette) Red(s string) string

func (Palette) Yellow

func (p Palette) Yellow(s string) string

Jump to

Keyboard shortcuts

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