ui

package
v0.1.4 Latest Latest
Warning

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

Go to latest
Published: Apr 29, 2020 License: MIT Imports: 9 Imported by: 0

Documentation

Index

Constants

View Source
const HexHash = "#"

Variables

This section is empty.

Functions

func GenerateTheme

func GenerateTheme(xmlpath, templpath string) error

func GenerateThemeFromJson

func GenerateThemeFromJson(jsonpath, templath string) error

Types

type AttrOption

type AttrOption struct {
	Option string      `xml:"name,attr"`
	Values []AttrValue `xml:"value>option"`
}

type AttrValue

type AttrValue struct {
	Name  string `xml:"name,attr"`
	Value string `xml:"value,attr"`
}

type ColorOptions

type ColorOptions struct {
	Name  string `xml:"name,attr"`
	Value string `xml:"value,attr"`
}

type JsonThemeFile

type JsonThemeFile struct {
	Foreground   string
	Background   string
	Keyword      string
	Functionname string
	Comment      string
	Constant     string
	String       string
	Type         string
	Builtin      string
	Warning      string
	Warning2     string
}

type ThemeFile

type ThemeFile struct {
	Colors     []ColorOptions `xml:"colors>option"`
	ThemeAttrs []AttrOption   `xml:"attributes>option"`
}

type ThemeMap

type ThemeMap struct {
	DarkBG      bool
	Fg1         string
	Fg2         string
	Bg1         string
	Bg01        string
	Bg2         string
	Bg3         string
	Bg4         string
	Builtin     string
	Keyword     string
	Constant    string
	Comment     string
	Func        string
	String      string
	Type        string
	Warning     string
	Warning2    string
	InvBuiltin  string
	InvKeyword  string
	InvType     string
	InvFunc     string
	InvString   string
	InvWarning  string
	InvWarning2 string
}

ThemeMap represents all colors of an ui theme. It holds the theme's background color and darker / lighter shades thereof, foregroundcolors in varying shades and colors, and a boolean that is set to true if the background color counts as "dark".

func NewThemeMap

func NewThemeMap(td *ThemeFile) (ThemeMap, error)

func NewThemeMapFromJson

func NewThemeMapFromJson(file *JsonThemeFile) (ThemeMap, error)

Jump to

Keyboard shortcuts

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