colors

package
v0.0.0 Latest Latest
Warning

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

Go to latest
Published: Feb 5, 2026 License: Apache-2.0, UNKNOWN not legal advice Imports: 0 Imported by: 0

Documentation

Index

Constants

View Source
const (
	ANSIReset      = "\x1b[0m"
	ANSIBright     = "\x1b[1m"
	ANSIDim        = "\x1b[2m"
	ANSIUnderscore = "\x1b[4m"
	ANSIBlink      = "\x1b[5m"
	ANSIReverse    = "\x1b[7m"
	ANSIHidden     = "\x1b[8m"

	ANSIFgBlack   = "\x1b[30m"
	ANSIFgRed     = "\x1b[31m"
	ANSIFgGreen   = "\x1b[32m"
	ANSIFgYellow  = "\x1b[33m"
	ANSIFgBlue    = "\x1b[34m"
	ANSIFgMagenta = "\x1b[35m"
	ANSIFgCyan    = "\x1b[36m"
	ANSIFgWhite   = "\x1b[37m"

	ANSIFgGray = "\x1b[90m" // bright black

	ANSIBgBlack   = "\x1b[40m"
	ANSIBgRed     = "\x1b[41m"
	ANSIBgGreen   = "\x1b[42m"
	ANSIBgYellow  = "\x1b[43m"
	ANSIBgBlue    = "\x1b[44m"
	ANSIBgMagenta = "\x1b[45m"
	ANSIBgCyan    = "\x1b[46m"
	ANSIBgWhite   = "\x1b[47m"
)

Variables

This section is empty.

Functions

func Black

func Black(args ...any) string

func Blackf

func Blackf(format string, args ...any) string

func Blue

func Blue(args ...any) string

func Bluef

func Bluef(format string, args ...any) string

func ColoredBytes

func ColoredBytes(data []byte, textColor, bytesColor func(...any) string) string

func ColoredBytesN

func ColoredBytesN(data []byte, n int, textColor, bytesColor func(...any) string) string

result may be 4 ASNSII chars longer than they should be to denote the elipses (...), and one for a trailing hex nibble in case the last byte is non-ascii. NOTE: it is annoying to try make this perfect and always fit within n, so we don't do this yet, but left as an exercise. :)

func Cyan

func Cyan(args ...any) string

func Cyanf

func Cyanf(format string, args ...any) string

func DefaultColoredBytes

func DefaultColoredBytes(data []byte) string

func DefaultColoredBytesN

func DefaultColoredBytesN(data []byte, n int) string

func Gray

func Gray(args ...any) string

func Grayf

func Grayf(format string, args ...any) string

func Green

func Green(args ...any) string

func Greenf

func Greenf(format string, args ...any) string

func Magenta

func Magenta(args ...any) string

func Magentaf

func Magentaf(format string, args ...any) string

func None

func None(args ...any) string

func Nonef

func Nonef(format string, args ...any) string

func Red

func Red(args ...any) string

func RedBg

func RedBg(args ...any) string

func Redf

func Redf(format string, args ...any) string

func White

func White(args ...any) string

func Whitef

func Whitef(format string, args ...any) string

func Yellow

func Yellow(args ...any) string

func Yellowf

func Yellowf(format string, args ...any) string

Types

type Color

type Color func(args ...any) string

Directories

Path Synopsis
cmd
modcolor command

Jump to

Keyboard shortcuts

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