terminal

package
v0.4.0 Latest Latest
Warning

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

Go to latest
Published: May 23, 2026 License: MIT Imports: 4 Imported by: 0

Documentation

Overview

Package terminal provides ANSI-colored terminal rendering for evaluation reports.

Index

Constants

View Source
const (
	Reset     = "\033[0m"
	Bold      = "\033[1m"
	Dim       = "\033[2m"
	Underline = "\033[4m"

	// Foreground colors
	Red     = "\033[31m"
	Green   = "\033[32m"
	Yellow  = "\033[33m"
	Blue    = "\033[34m"
	Magenta = "\033[35m"
	Cyan    = "\033[36m"
	White   = "\033[37m"
	Gray    = "\033[90m"

	// Bright foreground colors
	BrightRed    = "\033[91m"
	BrightGreen  = "\033[92m"
	BrightYellow = "\033[93m"
	BrightBlue   = "\033[94m"
	BrightCyan   = "\033[96m"
	BrightWhite  = "\033[97m"

	// Background colors
	BgRed    = "\033[41m"
	BgGreen  = "\033[42m"
	BgYellow = "\033[43m"
	BgBlue   = "\033[44m"
)

ANSI color codes

Variables

This section is empty.

Functions

This section is empty.

Types

type Renderer

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

Renderer renders evaluation reports with ANSI colors.

func New

func New(w io.Writer) *Renderer

New creates a new colored terminal renderer.

func NewNoColor

func NewNoColor(w io.Writer) *Renderer

NewNoColor creates a renderer without ANSI colors.

func (*Renderer) Render

func (r *Renderer) Render(report *evaluation.EvaluationReport) error

Render outputs the evaluation report with ANSI colors.

func (*Renderer) SetColor

func (r *Renderer) SetColor(enabled bool)

SetColor enables or disables ANSI colors.

Jump to

Keyboard shortcuts

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