color

package
v0.2.0 Latest Latest
Warning

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

Go to latest
Published: Sep 26, 2024 License: Apache-2.0 Imports: 4 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func AddTheme

func AddTheme(name string, themeFactory themeFactory)

func GetIsActive

func GetIsActive() bool

func HasTheme

func HasTheme(name string) bool

func NewColoredWriter

func NewColoredWriter(writer io.Writer, colors ...Color) io.Writer

func SetIsActive

func SetIsActive(active bool)

Types

type Color

type Color int
const (
	BlackColor  Color = 30
	BlueColor   Color = 34
	CyanColor   Color = 36
	GrayColor   Color = 37
	GreenColor  Color = 32
	PurpleColor Color = 35
	RedColor    Color = 31
	WhiteColor  Color = 97
	YellowColor Color = 33

	BlackBackground  Color = 40
	BlueBackground   Color = 44
	CyanBackground   Color = 46
	GrayBackground   Color = 47
	GreenBackground  Color = 42
	PurpleBackground Color = 45
	RedBackground    Color = 41
	WhiteBackground  Color = 107
	YellowBackground Color = 43

	BoldText      Color = 1
	UnderlineText Color = 4
)

type Theme

type Theme interface {
	GetWriter(name string) io.Writer
}

func GetTheme

func GetTheme(name string, writer io.Writer) Theme

func NewTheme

func NewTheme(writer io.Writer, colors map[string][]Color) Theme

Jump to

Keyboard shortcuts

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