themes

package
v0.0.0-...-d1f57cd Latest Latest
Warning

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

Go to latest
Published: Jan 16, 2023 License: GPL-3.0 Imports: 4 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func ApplyAsContrast

func ApplyAsContrast(p material.Palette, pair ContrastPair) material.Palette

func ApplyAsNormal

func ApplyAsNormal(p material.Palette, pair ContrastPair) material.Palette

Types

type ContrastPair

type ContrastPair struct {
	Fg, Bg color.NRGBA
}

func PairFor

func PairFor(bg color.NRGBA) ContrastPair

PairFor wraps the provided theme color in a Color type with an automatically populated Text color. The Text field value is chosen based on the luminance of the provided color.

type Swatch

type Swatch struct {
	Light, Dark, Default ContrastPair
}

type Theme

type Theme struct {
	*material.Theme
	Primary    Swatch
	Secondary  Swatch
	Background Swatch

	Ancestors, Descendants, Selected, Siblings, Unselected *color.NRGBA

	Inset unit.Value
}

func NewTheme

func NewTheme() *Theme

func (*Theme) ToDark

func (t *Theme) ToDark()

Jump to

Keyboard shortcuts

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