color

package
v2.2.2 Latest Latest
Warning

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

Go to latest
Published: May 29, 2026 License: GPL-3.0 Imports: 3 Imported by: 0

Documentation

Overview

Package color provides minimal ANSI terminal color helpers. It has zero external dependencies and respects the NO_COLOR env var and a runtime disable flag (set by --no-color).

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func Blue

func Blue(s string) string

Blue returns s in blue.

func Bold

func Bold(s string) string

Bold returns s in bold.

func BoldBlue

func BoldBlue(s string) string

BoldBlue returns s bold blue.

func BoldCyan

func BoldCyan(s string) string

BoldCyan returns s bold cyan.

func BoldGreen

func BoldGreen(s string) string

BoldGreen returns s bold green.

func BoldMagenta

func BoldMagenta(s string) string

BoldMagenta returns s bold magenta.

func BoldYellow

func BoldYellow(s string) string

BoldYellow returns s bold yellow.

func Bracket

func Bracket(s string) string

Bracket wraps s in white brackets with yellow content: [s].

func Cyan

func Cyan(s string) string

Cyan returns s in cyan.

func Disable

func Disable()

Disable turns off all color output (called by --no-color flag).

func Enable

func Enable()

Enable turns color output back on.

func Gray

func Gray(s string) string

Gray returns s in dark gray.

func Green

func Green(s string) string

Green returns s in green.

func HiBlue

func HiBlue(s string) string

HiBlue returns s in bright blue.

func HiCyan

func HiCyan(s string) string

HiCyan returns s in bright cyan.

func IsDisabled

func IsDisabled() bool

IsDisabled reports whether color is currently disabled.

func Magenta

func Magenta(s string) string

Magenta returns s in magenta.

func Red

func Red(s string) string

Red returns s in red.

func Section

func Section(title string) string

Section prints a bold section header (## Title).

func Table

func Table(rows [][]string, hasHeader bool) string

Table renders rows as a left-aligned plain-text table with a " | " separator. The first row is treated as a header and printed in bold cyan.

func White

func White(s string) string

White returns s in white.

func Yellow

func Yellow(s string) string

Yellow returns s in yellow.

Types

This section is empty.

Jump to

Keyboard shortcuts

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