color

package
v0.0.0-...-2cb8b77 Latest Latest
Warning

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

Go to latest
Published: Nov 19, 2024 License: Apache-2.0, Apache-2.0 Imports: 2 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func ANSIColorize

func ANSIColorize(text string, color int) string

ANSIColorize colors a string.

func Colorize

func Colorize(s string, c Paint) string

Colorize returns an ASCII colored string based on given color.

func Highlight

func Highlight(bb []byte, ii []int, c int) []byte

Highlight colorize bytes at given indices.

Types

type Paint

type Paint int

Paint describes a terminal color.

const (
	Black     Paint = iota + 30 // 30
	Red                         // 31
	Green                       // 32
	Yellow                      // 33
	Blue                        // 34
	Magenta                     // 35
	Cyan                        // 36
	LightGray                   // 37
	DarkGray  = 90

	Bold = 1
)

Defines basic ANSI colors.

Jump to

Keyboard shortcuts

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