palette

package
v3.0.0-rc67 Latest Latest
Warning

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

Go to latest
Published: Nov 15, 2026 License: Apache-2.0 Imports: 1 Imported by: ? modules, 0 packages

The first number is the count of modules that contain a package that imports this one. The module count is a better indicator of popularity than the package count. A module with 100 importing packages is counted only once instead of 100 times, reflecting the fact that the choice to use the package was likely made only once, not 100 times.
A '?' means that the value hasn't been computed yet.

Documentation

Index

Constants

View Source
const (
	DefaultPrimary   = "himagenta"
	DefaultSecondary = "hiblack"
	DefaultOptimal   = "higreen"
	DefaultError     = "hired"
	DefaultWarning   = "hiyellow"
	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