theme

package
v0.9.2 Latest Latest
Warning

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

Go to latest
Published: Jun 29, 2026 License: MIT Imports: 13 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

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