color

package
v1.32.1 Latest Latest
Warning

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

Go to latest
Published: Apr 26, 2026 License: MIT Imports: 2 Imported by: 0

Documentation

Overview

Package color provides color detection and theming for CLI output.

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func IsTerminal

func IsTerminal(f *os.File) bool

IsTerminal returns true if the given file descriptor is a terminal.

func Profile

func Profile(noColorFlag bool) bool

Profile detects the current color profile based on environment variables and flags. Returns true if color output should be enabled.

Color is disabled when any of:

  • NO_COLOR env is set (any value, per https://no-color.org)
  • CLICOLOR=0
  • TERM=dumb
  • noColorFlag is true (--no-color CLI flag)

Types

type Theme

type Theme struct {
	Pass      lipgloss.Style
	Fail      lipgloss.Style
	Warning   lipgloss.Style
	Skip      lipgloss.Style
	Info      lipgloss.Style
	Header    lipgloss.Style
	CheckName lipgloss.Style
	Muted     lipgloss.Style
}

Theme holds lipgloss styles for doctor output.

func NewTheme

func NewTheme(color bool) Theme

NewTheme creates a Theme. When color is false, all styles are empty (no ANSI codes).

Jump to

Keyboard shortcuts

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