colors

package
v0.0.0-...-a29cd33 Latest Latest
Warning

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

Go to latest
Published: Oct 1, 2021 License: MIT Imports: 4 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func ANSI256

func ANSI256(color uint8) string

TODO(SuperPaintman): make it inlinable.

func BgANSI256

func BgANSI256(color uint8) string

TODO(SuperPaintman): make it inlinable.

func BgTrueColor

func BgTrueColor(r, g, b uint8) string

func BgTrueColorRGB

func BgTrueColorRGB(color RGB) string

func SetMode

func SetMode(m Mode)

func SupportsANSI256

func SupportsANSI256() bool

func SupportsColor

func SupportsColor() bool

func SupportsTrueColor

func SupportsTrueColor() bool

func TrueColor

func TrueColor(r, g, b uint8) string

24-bit or truecolor or ANSI 16 millions.

func TrueColorRGB

func TrueColorRGB(color RGB) string

Types

type Attribute

type Attribute uint8
const (
	Reset              Attribute = 0
	ResetBold          Attribute = 22 // 21 isn't widely supported and 22 does the same thing.
	ResetDim           Attribute = 22
	ResetItalic        Attribute = 23
	ResetUnderline     Attribute = 24
	ResetInverse       Attribute = 27
	ResetHidden        Attribute = 28
	ResetStrikethrough Attribute = 29
	ResetOverline      Attribute = 55

	Bold          Attribute = 1
	Dim           Attribute = 2
	Italic        Attribute = 3
	Underline     Attribute = 4
	Inverse       Attribute = 7
	Hidden        Attribute = 8
	Strikethrough Attribute = 9
	Overline      Attribute = 53
)
const (
	ResetColor Attribute = 39

	Black   Attribute = 30
	Red     Attribute = 31
	Green   Attribute = 32
	Yellow  Attribute = 33
	Blue    Attribute = 34
	Magenta Attribute = 35
	Cyan    Attribute = 36
	White   Attribute = 37

	BlackBright   Attribute = 90
	RedBright     Attribute = 91
	GreenBright   Attribute = 92
	YellowBright  Attribute = 93
	BlueBright    Attribute = 94
	MagentaBright Attribute = 95
	CyanBright    Attribute = 96
	WhiteBright   Attribute = 97

	// Aliases.
	Gray Attribute = BlackBright
)
const (
	ResetBgColor Attribute = 49

	BgBlack   Attribute = 40
	BgRed     Attribute = 41
	BgGreen   Attribute = 42
	BgYellow  Attribute = 43
	BgBlue    Attribute = 44
	BgMagenta Attribute = 45
	BgCyan    Attribute = 46
	BgWhite   Attribute = 47

	BgBlackBright   Attribute = 100
	BgRedBright     Attribute = 101
	BgGreenBright   Attribute = 102
	BgYellowBright  Attribute = 103
	BgBlueBright    Attribute = 104
	BgMagentaBright Attribute = 105
	BgCyanBright    Attribute = 106
	BgWhiteBright   Attribute = 107

	// Aliases.
	BgGray Attribute = BgBlackBright
)

func (Attribute) Reset

func (a Attribute) Reset() Attribute

func (Attribute) String

func (a Attribute) String() string

type Mode

type Mode uint8
const (
	Auto Mode = 1 << iota >> 1
	Never
	Always
	ForceANSI256
	ForceTrueColor
)

type RGB

type RGB struct {
	R, G, B uint8
}

Directories

Path Synopsis
internal

Jump to

Keyboard shortcuts

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