theme

package
v0.3.0 Latest Latest
Warning

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

Go to latest
Published: May 15, 2024 License: MIT Imports: 12 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

View Source
var (
	DefaultHover    = 48
	DefaultSelected = 96
)

Functions

func LoadBuiltin

func LoadBuiltin(fontDir string, embeddedFonts [][]byte) []font.FontFace

LoadBuiltin loads fonts from the belowing sources: 1. The provided dir. 2. embedded font bytes. 3. The Gio builtin Go font collection.

Types

type Palette added in v0.0.2

type Palette struct {
	// Bg is the background color atop which content is currently being
	// drawn.
	Bg color.NRGBA

	// Fg is a color suitable for drawing on top of Bg.
	Fg color.NRGBA

	// ContrastBg is a color used to draw attention to active,
	// important, interactive widgets such as buttons.
	ContrastBg color.NRGBA

	// ContrastFg is a color suitable for content drawn on top of
	// ContrastBg.
	ContrastFg color.NRGBA

	// Bg2 specifies the background color for components like navibar
	Bg2 color.NRGBA

	HoverAlpha, SelectedAlpha uint8
}

type SubThemeID added in v0.0.2

type SubThemeID string

type Theme

type Theme struct {
	*material.Theme

	// Alpha is the set of alpha values to be applied for certain
	// states like hover, selected, etc...
	HoverAlpha, SelectedAlpha uint8

	// Bg2 specifies the background color for components like navibar
	Bg2 color.NRGBA
	// contains filtered or unexported fields
}

func NewTheme

func NewTheme(fontDir string, embeddedFonts [][]byte, noSystemFonts bool) *Theme

NewTheme instantiates a theme, extending material theme.

func (*Theme) Get added in v0.0.2

func (th *Theme) Get(ID SubThemeID) interface{}

func (*Theme) Register added in v0.0.2

func (th *Theme) Register(ID SubThemeID, sub interface{}) error

func (*Theme) WithPalette added in v0.0.2

func (t *Theme) WithPalette(p Palette) *Theme

Jump to

Keyboard shortcuts

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