palette

package
v0.0.0-...-6295505 Latest Latest
Warning

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

Go to latest
Published: May 31, 2024 License: Apache-2.0 Imports: 1 Imported by: 0

Documentation

Index

Constants

View Source
const (
	DefaultPrimary   = "himagenta"
	DefaultSecondary = "hiblack"
	DefaultOptimal   = "green"
	DefaultError     = "red"
	DefaultWarning   = "yellow"
	DefaultFrozen    = "hiblue"
)

The color names as string, usable in configuration files.

Variables

This section is empty.

Functions

This section is empty.

Types

type C

type C color.Attribute

C is the integer reprenstation of the color (ANSI code).

type ColorPalette

type ColorPalette struct {
	Primary   color.Attribute
	Secondary color.Attribute
	Optimal   color.Attribute
	Error     color.Attribute
	Warning   color.Attribute
	Frozen    color.Attribute
	Bold      color.Attribute
}

ColorPalette declares the color (as C) to use for each role.

func DefaultColorPalette

func DefaultColorPalette() *ColorPalette

func New

New returns a color palette (as C) from a string color palette (as read by viper).

type ColorPaletteFunc

type ColorPaletteFunc struct {
	Primary   func(a ...any) string
	Secondary func(a ...any) string
	Optimal   func(a ...any) string
	Error     func(a ...any) string
	Warning   func(a ...any) string
	Frozen    func(a ...any) string
	Bold      func(a ...any) string
}

ColorPaletteFunc declares the string colorizer to use for each role.

func DefaultFuncPalette

func DefaultFuncPalette() *ColorPaletteFunc

func NewFunc

func NewFunc(m StringPalette) *ColorPaletteFunc

NewFunc returns a color palette (as string colorizer func) from a string color palette (as read by viper).

type StringPalette

type StringPalette struct {
	Primary   string
	Secondary string
	Optimal   string
	Error     string
	Warning   string
	Frozen    string
}

StringPalette declares the color (as string) to use for each role.

func DefaultPalette

func DefaultPalette() *StringPalette

Jump to

Keyboard shortcuts

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