context

package
v1.0.0 Latest Latest
Warning

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

Go to latest
Published: May 12, 2024 License: MIT Imports: 7 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type Context

type Context struct {
	// All the themes available
	// Fetched from vendor
	Themes []Theme

	// Icons!
	Icons map[string]Icon

	// Config
	TLockConfig config.TLockConfig

	// Core
	Core *tlockcore.TLockCore

	// User configuration
	Config config.UserConfiguration
}

Represents a context

func InitializeContext

func InitializeContext() Context

Initializes a new instance of the context It is recommended to call this at a one place and then pass around the context

func (Context) GetCurrentTheme

func (context Context) GetCurrentTheme() Theme

Returns the current theme spec

func (*Context) SetTheme

func (context *Context) SetTheme(theme string)

Sets the theme

type Icon

type Icon struct {
	Unicode string
	Hex     string
}

type Theme

type Theme struct {
	// Name
	Name string

	// Background
	Background lipgloss.Color

	// Background over
	BackgroundOver lipgloss.Color

	// Sub text
	SubText lipgloss.Color

	// Accent
	Accent lipgloss.Color

	// Foreground
	Foreground lipgloss.Color

	// Error
	Error lipgloss.Color
}

Represents a theme

Jump to

Keyboard shortcuts

? : This menu
/ : Search site
f or F : Jump to
y or Y : Canonical URL
JackTT - Gopher 🇻🇳