ansi

package
v1.2.3 Latest Latest
Warning

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

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

Documentation

Overview

vendored from https://github.com/mgutz/ansi

Index

Constants

View Source
const (

	// Reset is the ANSI reset escape sequence
	Reset = "\033[0m"
	// DefaultBG is the default background
	DefaultBG = "\033[49m"
	// DefaultFG is the default foreground
	DefaultFG = "\033[39m"
)

Variables

View Source
var Black string

Black FG

View Source
var Blue string

Blue FG

View Source
var (

	// Colors maps common color names to their ANSI color code.
	Colors = map[string]int{
		"black":   black,
		"red":     red,
		"green":   green,
		"yellow":  yellow,
		"blue":    blue,
		"magenta": magenta,
		"cyan":    cyan,
		"white":   white,
		"default": defaultt,
	}
)
View Source
var Cyan string

Cyan FG

View Source
var Green string

Green FG

View Source
var LightBlack string

LightBlack FG

View Source
var LightBlue string

LightBlue FG

View Source
var LightCyan string

LightCyan FG

View Source
var LightGreen string

LightGreen FG

View Source
var LightMagenta string

LightMagenta FG

View Source
var LightRed string

LightRed FG

View Source
var LightWhite string

LightWhite FG

View Source
var LightYellow string

LightYellow FG

View Source
var Magenta string

Magenta FG

Red FG

View Source
var White string

White FG

View Source
var Yellow string

Yellow FG

Functions

func Color

func Color(s, style string) string

Color colors a string based on the ANSI color code for style.

func ColorCode

func ColorCode(style string) string

ColorCode returns the ANSI color color code for style.

func ColorFunc

func ColorFunc(style string) func(string) string

ColorFunc creates a closure to avoid computation ANSI color code.

func DisableColors

func DisableColors(disable bool)

DisableColors disables ANSI color codes. The default is false (colors are on).

Types

This section is empty.

Jump to

Keyboard shortcuts

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