theme

package
v0.1.0 Latest Latest
Warning

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

Go to latest
Published: May 21, 2022 License: MIT Imports: 6 Imported by: 0

Documentation

Index

Constants

View Source
const (
	AttrBold = 1 << iota
	AttrBlink
	AttrReverse
	AttrUnderline
	AttrDim
	AttrItalic
	AttrStrikethrough
	AttrHidden
	AttrNone AttrMask = 0
)

Variables

This section is empty.

Functions

func AddTheme

func AddTheme(name string, loader func() ([]byte, error))

Types

type AttrMask

type AttrMask int

func Attr

func Attr(s string) (AttrMask, error)

func (*AttrMask) UnmarshalYAML

func (a *AttrMask) UnmarshalYAML(unmarshal func(interface{}) error) error

type Color

type Color struct {
	R, G, B uint8
}

func HexColor

func HexColor(s string) (c Color, err error)

func MustHexColor

func MustHexColor(s string) Color

func (Color) Hex

func (c Color) Hex() string

func (*Color) UnmarshalYAML

func (c *Color) UnmarshalYAML(unmarshal func(interface{}) error) error

type Style

type Style struct {
	Fg, Bg *Color
	Attr   AttrMask
}

type Theme

type Theme map[string]Style

func LoadTheme

func LoadTheme(name string) (Theme, error)

func NewTheme

func NewTheme(rules map[string]Style) (Theme, error)

func NewThemeFromYaml

func NewThemeFromYaml(data []byte) (Theme, error)

func (Theme) Style

func (t Theme) Style(group string) Style

Jump to

Keyboard shortcuts

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