page

package
v0.0.0-...-05bb6ad Latest Latest
Warning

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

Go to latest
Published: Apr 3, 2024 License: Unlicense Imports: 10 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

View Source
var (
	Light = Palette{
		Error:         rgb(0xB00020),
		Surface:       rgb(0xFFFFFF),
		Bg:            rgb(0xDCDCDC),
		BgSecondary:   rgb(0xEBEBEB),
		OnError:       rgb(0xFFFFFF),
		OnSurface:     rgb(0x000000),
		OnBg:          rgb(0x000000),
		OnBgSecondary: rgb(0x000000),
	}
	Dark = Palette{
		Error:         rgb(0xB00020),
		Surface:       rgb(0x222222),
		Bg:            rgb(0x000000),
		BgSecondary:   rgb(0x444444),
		OnError:       rgb(0xFFFFFF),
		OnSurface:     rgb(0xFFFFFF),
		OnBg:          rgb(0xEEEEEE),
		OnBgSecondary: rgb(0xFFFFFF),
	}
)

Functions

This section is empty.

Types

type Config

type Config struct {
	// theme to use {light,dark}.
	Theme string
	// loadSize specifies maximum number of items to load at a time.
	LoadSize int
}

type Page

type Page interface {
	Actions() []component.AppBarAction
	Overflow() []component.OverflowAction
	Layout(gtx layout.Context, th *Theme, loadSize int) layout.Dimensions
	NavItem() component.NavItem
}

type Palette

type Palette struct {
	// Error used to indicate errors.
	Error   color.NRGBA
	OnError color.NRGBA
	// Surface affect surfaces of components, such as cards, sheets and menus.
	Surface   color.NRGBA
	OnSurface color.NRGBA
	// Bg appears behind scrollable content.
	Bg   color.NRGBA
	OnBg color.NRGBA
	// BgSecondary appears behind scrollable content.
	BgSecondary   color.NRGBA
	OnBgSecondary color.NRGBA
}

Palette defines non-brand semantic colors.

`On` colors define a color that is appropriate to display atop its counterpart.

type Router

type Router struct {
	*component.ModalNavDrawer
	NavAnim component.VisibilityAnimation
	*component.AppBar
	*component.ModalLayer
	NonModalDrawer, BottomBar bool
	*app.Window
	// contains filtered or unexported fields
}

func NewRouter

func NewRouter(w *app.Window) Router

func (*Router) Layout

func (r *Router) Layout(gtx layout.Context, th *Theme, loadSize int) layout.Dimensions

func (*Router) Register

func (r *Router) Register(tag interface{}, p Page)

func (*Router) SwitchTo

func (r *Router) SwitchTo(tag interface{})

type Theme

type Theme struct {
	*material.Theme
	// Palette specifies semantic colors.
	Palette Palette
}

Theme wraps the material.Theme with useful application-specific theme information.

func NewTheme

func NewTheme(conf *Config) *Theme

NewTheme instantiates a theme using the provided fonts.

func (*Theme) UsePalette

func (t *Theme) UsePalette(p Palette)

UsePalette changes to the specified palette.

type UserColorData

type UserColorData struct {
	color.NRGBA
	Luminance float64
}

UserColorData tracks both a color and its luminance.

Directories

Path Synopsis

Jump to

Keyboard shortcuts

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