color

package
v0.0.0-...-df23a76 Latest Latest
Warning

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

Go to latest
Published: Jul 1, 2022 License: Apache-2.0 Imports: 4 Imported by: 0

Documentation

Overview

Package color provides functionality to displayed colored text on the terminal.

Index

Constants

This section is empty.

Variables

View Source
var (
	Grey          = color.New(color.FgWhite)
	Red           = color.New(color.FgHiRed)
	Cyan          = color.New(color.FgCyan)
	BoldUnderline = color.New(color.Bold, color.Underline)
	Magenta       = color.New(color.FgMagenta)
	Blue          = color.New(color.FgBlue)
)

Predefined colors. Refer to https://en.wikipedia.org/wiki/ANSI_escape_code to validate if colors would be visible on white or black screen backgrounds.

Functions

func DisableColorBasedOnEnvVar

func DisableColorBasedOnEnvVar()

DisableColorBasedOnEnvVar determines whether the CLI will produce color output based on the environment variable, COLOR.

func HighlightCode

func HighlightCode(s string) string

HighlightCode wraps the string with the ` character, colors it to denote it's a code block, and returns it.

func HighlightResource

func HighlightResource(s string) string

HighlightResource colors the string to denote it as a resource created by the CLI, and returns it.

func HighlightUserInput

func HighlightUserInput(s string) string

HighlightUserInput colors the string to denote it as an input from standard input, and returns it.

Types

This section is empty.

Jump to

Keyboard shortcuts

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