themes

package
v1.0.1 Latest Latest
Warning

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

Go to latest
Published: Aug 23, 2021 License: Apache-2.0 Imports: 5 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

View Source
var (
	// SystemDir is the Location of installed themes
	SystemDir string
	// Current is the theme to use when rendering
	Current Theme
)
View Source
var ErrThemeMissing = errors.New("unable to find specified theme")

ErrThemeMissing occurs when a configured theme cannot be found

Functions

func Dirs

func Dirs()

Dirs builds a list of theme directories for searching

func Load

func Load(name string) error

Load reads in a theme

Types

type Colors

type Colors struct {
	// 4-bit color for Linux Console
	C8 struct {
		FG color.Color
		BG color.Color
	}
	// 8-bit color for full terminals
	C256 struct {
		FG color.Color
		BG color.Color
	}
}

Colors defines FG/BG color pairs for themes

type Piece

type Piece struct {
	// ASCII symbol for non-Unicode terminals (Linux console)
	ASCII string `json:"ascii"`
	// Unicode symbol for Unicode terminals
	Unicode string `json:"unicode"`
	// 4-bit color for Linux Console
	C8 struct {
		FG color.Color `json:"fg"`
		BG color.Color `json:"bg"`
	} `json:"8"`
	// 8-bit color for full terminals
	C256 struct {
		FG color.Color `json:"fg"`
		BG color.Color `json:"bg"`
	} `json:"256"`
}

Piece is the configuration for a Piece when rendering

type Symbol

type Symbol struct {
	// ASCII symbol for non-unicode terminals
	ASCII string
	// Unicode symbol for full terminals
	Unicode string
}

Symbol configurable "icon" for Piece rendering

type Theme

type Theme map[string]Piece

Theme is a theme for sup

Jump to

Keyboard shortcuts

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