theme

package
v0.0.0-...-acf18e3 Latest Latest
Warning

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

Go to latest
Published: Jul 2, 2024 License: MIT Imports: 6 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func SaveDefault

func SaveDefault(path string) error

Saves the unexported default theme data.

func SaveTheme

func SaveTheme(jt *jsonTheme, path string) error

Saves the JSON data structure at the specified path. Errors are related to JSON data corruption or file handling.

Types

type ButtonTheme

type ButtonTheme struct {
	Text *color.NRGBA

	Idle    *color.NRGBA
	Hover   *color.NRGBA
	Pressed *color.NRGBA
}

type LabelTheme

type LabelTheme struct {
	Text *color.RGBA
}

type MapTheme

type MapTheme struct {
	// If true, a border will be present around cells.
	// If config.Config.ZoomMin equals config.ZOOM_MIN_LIMIT,
	// border is always disabled.
	Border bool

	// Background color - essentially, border color
	Background *color.RGBA

	// Color of the alive cell
	CellAlive *color.RGBA

	// Color of the dead cell
	CellDead *color.RGBA
}

type PanelTheme

type PanelTheme struct {
	Background *color.NRGBA
}

type TextInputTheme

type TextInputTheme struct {
	Text          *color.RGBA
	Idle          *color.RGBA
	Disabled      *color.RGBA
	Caret         *color.RGBA
	DisabledCaret *color.RGBA
}

type Theme

type Theme struct {
	// Map theme: cells and border
	MapTheme *MapTheme

	// User interface theme
	UITheme *UITheme
}

Represents the color theme of the game.

func LoadTheme

func LoadTheme(path string) *Theme

Loads color theme from file. If the file does not exist, returns default theme.

type UITheme

type UITheme struct {
	InfoPanel *PanelTheme
	CtrlPanel *PanelTheme

	Generation *LabelTheme
	Speed      *LabelTheme
	Zoom       *LabelTheme

	PlayToggle *ButtonTheme
	SlowDown   *ButtonTheme
	SpeedUp    *ButtonTheme

	ResetState  *ButtonTheme
	RandomState *ButtonTheme

	FF_I *ButtonTheme
	FF_X *ButtonTheme
	FF_L *ButtonTheme
	FF_C *ButtonTheme
	FF_M *ButtonTheme

	Rules *TextInputTheme
}

User Interface theme.

Jump to

Keyboard shortcuts

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