Help us shape the future of Go! Take the 2026 Go Developer Survey

color

package
v0.8.0 Latest Latest
Warning

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

Go to latest
Published: Oct 28, 2026 License: Apache-2.0 Imports: 4 Imported by: 0

Documentation

Overview

Package color decides how much color the CLI writes, so that the Markdown a command shows and the log agree. A decision never makes the CLI interactive: a prompt asks a terminal UI only where cmd/internal/prompt finds a terminal.

colorprofile, which lipgloss and charm.land/log use, reads NO_COLOR, CLICOLOR and CLICOLOR_FORCE only where they parse as a bool, and lets CLICOLOR_FORCE outrank NO_COLOR where the output is no terminal. It reads neither FORCE_COLOR nor a CI, which is why this package does.

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func Log

func Log(w io.Writer, environ []string) colorprofile.Profile

Log is Output for the log on w, which also takes color in a CI whose job log renders ANSI. The log is no output a script parses, so a CI colors it without being asked.

func Output

func Output(w io.Writer, environ []string) colorprofile.Profile

Output is the color profile of what a command writes to w. Without a terminal, only a forcing variable turns color on, since a script that captures or pipes the output wants it plain.

Types

This section is empty.

Jump to

Keyboard shortcuts

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