theme

package module
v0.0.0-...-7370393 Latest Latest
Warning

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

Go to latest
Published: Jan 3, 2025 License: MIT Imports: 8 Imported by: 0

README

Ebiten UI Themes

For mostly personal use. I needed a way to abstract away the colors of widgets in ebitenui

But if you want to use it...

I offer no support of any kind.

You have been warned.

meme me

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type Style

type Style struct {
	BackgroundColor color.RGBA        `yaml:"bg_color"`
	ForegroundColor color.RGBA        `yaml:"fg_color"`
	Image           *eimage.NineSlice `yaml:"image"`
}

Style represents the style data for a widget.

type StyleState

type StyleState struct {
	Idle       Style                  `yaml:"idle"`
	Disabled   *Style                 `yaml:"disabled"`
	Hover      *Style                 `yaml:"hover"`
	Pressed    *Style                 `yaml:"pressed"`
	CustomData map[string]interface{} `yaml:"custom_data"`
	Font       *text.Face             `yaml:"-"`
}

StyleState represents the style state data for a widget.

type Theme

type Theme struct {
	ButtonStyle      StyleState `yaml:"button"`
	LabelStyle       StyleState `yaml:"label"`
	TextStyle        StyleState `yaml:"text"`
	ProgressBarStyle StyleState `yaml:"progressbar"`
	TextInputStyle   StyleState `yaml:"textinput"`
	ContainerStyle   StyleState `yaml:"container"`
	CaretStyle       StyleState `yaml:"caret"`
	GraphicStyle     StyleState `yaml:"graphic"`
	Font             text.Face  `yaml:"-"`
}

Theme represents the theme data for EbitenUI.

func NewTheme

func NewTheme(font text.Face) *Theme

NewTheme creates a new theme with the given font. On Linux the theme is determined by the system theme, i.e. light or dark. On Linux, the theme is defaulted to dark if the system theme is undetermined.

func (*Theme) Button

func (th *Theme) Button(text string) []widget.ButtonOpt

Button returns the button options for the theme.

func (*Theme) Caret

func (th *Theme) Caret() []widget.CaretOpt

Caret returns the caret options for the theme.

func (*Theme) Container

func (th *Theme) Container() []widget.ContainerOpt

Container returns the container options for the theme.

func (*Theme) Graphic

func (th *Theme) Graphic(img *ebiten.Image) []widget.GraphicOpt

func (*Theme) Label

func (th *Theme) Label(text string) []widget.LabelOpt

Label returns the label options for the theme.

func (*Theme) ProgressBar

func (th *Theme) ProgressBar() []widget.ProgressBarOpt

ProgressBar returns the progress bar options for the theme.

func (*Theme) Text

func (th *Theme) Text(text string) []widget.TextOpt

Text returns the text options for the theme.

func (*Theme) TextInput

func (th *Theme) TextInput() []widget.TextInputOpt

TextInput returns the text input options for the theme.

Directories

Path Synopsis

Jump to

Keyboard shortcuts

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