colors

package
v0.5.0-alpha.3 Latest Latest
Warning

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

Go to latest
Published: Aug 1, 2023 License: MIT Imports: 4 Imported by: 1

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func Apply

func Apply(text string, color Color) string

Apply applies the specified color to the given text and returns the colorized text.

func IsTerminal added in v0.2.2

func IsTerminal(w io.Writer) bool

Types

type Color

type Color string

Color represents a text color.

const (
	Black   Color = "30"
	Red     Color = "31"
	Green   Color = "32"
	Yellow  Color = "33"
	Blue    Color = "34"
	Magenta Color = "35"
	Cyan    Color = "36"
	White   Color = "37"
)

Available colors.

Jump to

Keyboard shortcuts

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