catppuccin

package module
v1.0.0 Latest Latest
Warning

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

Go to latest
Published: Aug 25, 2025 License: MIT Imports: 4 Imported by: 0

README

Logo
Catppuccin for Fyne

Previews

🌻 Latte
🪴 Frappé
🌺 Macchiato
🌿 Mocha

Usage

  1. Run go get github.com/catppuccin/fyne

  2. Add an import of github.com/catppuccin/fyne to your code

  3. Call the app's Settings.().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)
        ...
    }
    

💝 Thanks to

 

Copyright © 2021-present Catppuccin Org

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"
	Base      Color = "base"
	Text      Color = "text"
)

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) GetNamedColor

func (ctp Theme) GetNamedColor(c Color) color.Color

Get a color from the named colors in catppuccin, useful to color in canvas elements in a consistent way

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

Directories

Path Synopsis

Jump to

Keyboard shortcuts

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