catppuccin

package module
v0.0.2 Latest Latest
Warning

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

Go to latest
Published: Mar 4, 2025 License: MIT Imports: 4 Imported by: 1

README

Logo
Catppuccin for Fyne

fyne_catppuccin

Usage

  1. Run go get github.com/mbaklor/fyne-catppuccin
  2. Add an import of github.com/mbaklor/fyne-catppuccin to your code
  3. Call the fyne app's SetTheme method with an instantiated theme struct:
    func main() {
        a := app.New()
    
        ctp := catppuccin.New() // this creates a Theme struct with blue as the accent color.
                                //you can instead call NewWithAccent() for a different accent color
        ctp.SetFlavor(catppuccin.Frappe) // if you want to follow the system theme don't set flavor manually.
                                         // by default uses Latte for light and Mocha for dark
        a.Settings().SetTheme(ctp)
        ...
    }
    

Documentation

Index

Constants

This section is empty.

Variables

View Source
var (
	Latte     = ctp.Latte
	Frappe    = ctp.Frappe
	Macchiato = ctp.Macchiato
	Mocha     = ctp.Mocha
)

Just an alias to the original catppuccin/go vars

Functions

This section is empty.

Types

type Color

type Color string
const (
	Rosewater Color = "rosewater"
	Flamingo  Color = "flamingo"
	Pink      Color = "pink"
	Mauve     Color = "mauve"
	Red       Color = "red"
	Maroon    Color = "maroon"
	Peach     Color = "peach"
	Yellow    Color = "yellow"
	Green     Color = "green"
	Teal      Color = "teal"
	Sky       Color = "sky"
	Sapphire  Color = "sapphire"
	Blue      Color = "blue"
	Lavender  Color = "lavender"
)

Possible colors for accent color

type Flavor

type Flavor ctp.Flavor

Just an alias to the original catppuccin/go type

type Theme

type Theme struct {
	// contains filtered or unexported fields
}

The main theme struct necessary for app.Settings().SetTheme(...)

func New

func New() Theme

Creates new Theme with the accent color set to blue

func NewWithAccent

func NewWithAccent(accent Color) Theme

Creates new Theme with the chosen accent color

func (Theme) Color

func (c Theme) Color(name fyne.ThemeColorName, variant fyne.ThemeVariant) color.Color

Implements fyne.Theme

Gets color from current theme with current accent and returns it for the app to handle

func (Theme) Font

func (ctp Theme) Font(style fyne.TextStyle) fyne.Resource

Implements fyne.Theme

func (Theme) Icon

func (ctp Theme) Icon(name fyne.ThemeIconName) fyne.Resource

Implements fyne.Theme

func (*Theme) ResetFlavor

func (ctp *Theme) ResetFlavor()

Remove any forced flavor, returns to Latte for light mode systems and Mocha for dark mode

func (*Theme) SetAccent

func (ctp *Theme) SetAccent(c Color)

Chooses a different accent color to set as Primary

func (*Theme) SetFlavor

func (ctp *Theme) SetFlavor(f Flavor)

Force a specific flavor of Catppuccin to the theme

func (Theme) Size

func (ctp Theme) Size(name fyne.ThemeSizeName) float32

Implements fyne.Theme

Jump to

Keyboard shortcuts

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