theme

package
v0.2.0 Latest Latest
Warning

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

Go to latest
Published: Sep 9, 2026 License: AGPL-3.0 Imports: 2 Imported by: 0

Documentation

Overview

Package theme catalogs selectable UI color palettes.

Add a palette in its own file, append it to Palettes, then run task theme-css.

Index

Constants

View Source
const (
	// PalettePlex is the default Outtake color palette.
	PalettePlex = "plex"

	// PaletteNeutral is the original zinc palette.
	PaletteNeutral = "neutral"

	// PaletteNord is the Nord palette.
	PaletteNord = "nord"

	// PaletteCatppuccin is the Catppuccin palette.
	PaletteCatppuccin = "catppuccin"

	// PaletteDracula is the Dracula palette.
	PaletteDracula = "dracula"

	// PaletteTokyoNight is the Tokyo Night palette.
	PaletteTokyoNight = "tokyo-night"
)

Variables

View Source
var Catppuccin = Palette{
	ID:      PaletteCatppuccin,
	Name:    "Catppuccin",
	Accent:  "#CBA6F7",
	Surface: "#1E1E2E",
	Light: Scheme{
		Background:        "oklch(0.958 0.006 264.532)",
		Foreground:        "oklch(0.435 0.043 279.325)",
		Card:              "oklch(0.98 0.004 264)",
		Primary:           catppuccinMauve,
		PrimaryForeground: "oklch(0.98 0.004 264)",
		Subtle:            "oklch(0.92 0.01 264)",
		MutedForeground:   "oklch(0.55 0.03 279)",
		Destructive:       "oklch(0.55 0.2 25)",
		Border:            "oklch(0.88 0.012 264)",
		Input:             "oklch(0.88 0.012 264)",
		Ring:              catppuccinMauve,
		Sidebar:           "oklch(0.94 0.008 264)",
		SidebarPrimary:    catppuccinMauve,
		SidebarAccent:     "oklch(0.9 0.012 264)",
	},
	Dark: Scheme{
		Background:        "oklch(0.243 0.03 283.911)",
		Foreground:        "oklch(0.879 0.043 272.277)",
		Card:              catppuccinMocha,
		Primary:           catppuccinBloom,
		PrimaryForeground: catppuccinMocha,
		Subtle:            "oklch(0.324 0.032 281.978)",
		MutedForeground:   "oklch(0.7 0.03 272)",
		Destructive:       "oklch(0.75 0.12 8)",
		Border:            darkHairline,
		Input:             darkWell,
		Ring:              catppuccinBloom,
		Sidebar:           catppuccinMocha,
		SidebarPrimary:    catppuccinBloom,
		SidebarAccent:     "oklch(0.324 0.032 281.978)",
	},
}

Catppuccin is the Catppuccin palette.

View Source
var Dracula = Palette{
	ID:      PaletteDracula,
	Name:    "Dracula",
	Accent:  "#BD93F9",
	Surface: "#282A36",
	Light: Scheme{
		Background:        "oklch(0.97 0.01 280)",
		Foreground:        draculaInk,
		Card:              white,
		Primary:           draculaPurple,
		PrimaryForeground: "oklch(0.98 0.008 106)",
		Subtle:            "oklch(0.93 0.015 280)",
		MutedForeground:   "oklch(0.5 0.03 278)",
		Destructive:       "oklch(0.58 0.2 25)",
		Border:            "oklch(0.88 0.02 280)",
		Input:             "oklch(0.88 0.02 280)",
		Ring:              draculaPurple,
		Sidebar:           "oklch(0.95 0.012 280)",
		SidebarPrimary:    draculaPurple,
		SidebarAccent:     "oklch(0.91 0.018 280)",
	},
	Dark: Scheme{
		Background:        draculaInk,
		Foreground:        "oklch(0.977 0.008 106.545)",
		Card:              "oklch(0.34 0.025 277)",
		Primary:           draculaGlow,
		PrimaryForeground: draculaInk,
		Subtle:            "oklch(0.403 0.032 277.832)",
		MutedForeground:   "oklch(0.7 0.04 278)",
		Destructive:       "oklch(0.68 0.19 25)",
		Border:            "oklch(1 0 0 / 12%)",
		Input:             "oklch(1 0 0 / 16%)",
		Ring:              draculaGlow,
		Sidebar:           "oklch(0.26 0.02 277)",
		SidebarPrimary:    draculaGlow,
		SidebarAccent:     "oklch(0.403 0.032 277.832)",
	},
}

Dracula is the Dracula palette.

View Source
var Neutral = Palette{
	ID:      PaletteNeutral,
	Name:    "Neutral",
	Accent:  "#E5E5E5",
	Surface: "#0A0A0A",
	Light: Scheme{
		Background:        white,
		Foreground:        neutralNight,
		Card:              white,
		Primary:           neutralInk,
		PrimaryForeground: neutralSnow,
		Subtle:            gray97,
		MutedForeground:   "oklch(0.556 0 0)",
		Destructive:       "oklch(0.577 0.245 27.325)",
		Border:            gray922,
		Input:             gray922,
		Ring:              "oklch(0.708 0 0)",
		Sidebar:           neutralSnow,
		SidebarPrimary:    neutralInk,
		SidebarAccent:     gray97,
	},
	Dark: Scheme{
		Background:        neutralNight,
		Foreground:        neutralSnow,
		Card:              neutralInk,
		Primary:           gray922,
		PrimaryForeground: neutralInk,
		Subtle:            "oklch(0.269 0 0)",
		MutedForeground:   "oklch(0.708 0 0)",
		Destructive:       "oklch(0.704 0.191 22.216)",
		Border:            darkHairline,
		Input:             darkWell,
		Ring:              "oklch(0.556 0 0)",
		Sidebar:           neutralInk,
		SidebarPrimary:    "oklch(0.488 0.243 264.376)",
		SidebarAccent:     "oklch(0.269 0 0)",
	},
}

Neutral is the original zinc palette.

View Source
var Nord = Palette{
	ID:      PaletteNord,
	Name:    "Nord",
	Accent:  "#88C0D0",
	Surface: "#2E3440",
	Light: Scheme{
		Background:        "oklch(0.951 0.007 260.732)",
		Foreground:        nordPolar,
		Card:              "oklch(0.97 0.005 260)",
		Primary:           nordFrost,
		PrimaryForeground: "oklch(0.951 0.007 260.732)",
		Subtle:            "oklch(0.9 0.012 260)",
		MutedForeground:   "oklch(0.45 0.03 264)",
		Destructive:       "oklch(0.577 0.118 19.8)",
		Border:            "oklch(0.85 0.015 260)",
		Input:             "oklch(0.85 0.015 260)",
		Ring:              nordFrost,
		Sidebar:           "oklch(0.92 0.01 260)",
		SidebarPrimary:    nordFrost,
		SidebarAccent:     "oklch(0.88 0.015 260)",
	},
	Dark: Scheme{
		Background:        nordPolar,
		Foreground:        "oklch(0.899 0.016 262.749)",
		Card:              "oklch(0.379 0.029 266.471)",
		Primary:           nordAurora,
		PrimaryForeground: nordPolar,
		Subtle:            "oklch(0.42 0.03 266)",
		MutedForeground:   "oklch(0.72 0.02 260)",
		Destructive:       "oklch(0.63 0.12 20)",
		Border:            darkHairline,
		Input:             darkWell,
		Ring:              nordAurora,
		Sidebar:           "oklch(0.3 0.025 264)",
		SidebarPrimary:    nordAurora,
		SidebarAccent:     "oklch(0.379 0.029 266.471)",
	},
}

Nord is the Nord palette.

View Source
var Plex = Palette{
	ID:      PalettePlex,
	Name:    "Plex",
	Accent:  "#E5A00D",
	Surface: "#1B1B1B",
	Light: Scheme{
		Background:        "oklch(0.985 0.005 80)",
		Foreground:        plexInk,
		Card:              white,
		Primary:           plexGold,
		PrimaryForeground: plexInk,
		Subtle:            "oklch(0.96 0.012 80)",
		MutedForeground:   "oklch(0.55 0 0)",
		Destructive:       "oklch(0.577 0.245 27.325)",
		Border:            "oklch(0.91 0.012 80)",
		Input:             "oklch(0.91 0.012 80)",
		Ring:              plexGold,
		Sidebar:           "oklch(0.975 0.008 80)",
		SidebarPrimary:    plexGold,
		SidebarAccent:     "oklch(0.96 0.012 80)",
	},
	Dark: Scheme{
		Background:        plexInk,
		Foreground:        gray97,
		Card:              "oklch(0.285 0 0)",
		Primary:           plexGold,
		PrimaryForeground: plexInk,
		Subtle:            "oklch(0.32 0 0)",
		MutedForeground:   "oklch(0.715 0 0)",
		Destructive:       "oklch(0.704 0.191 22.216)",
		Border:            darkHairline,
		Input:             darkWell,
		Ring:              plexGold,
		Sidebar:           "oklch(0.26 0 0)",
		SidebarPrimary:    plexGold,
		SidebarAccent:     "oklch(0.32 0 0)",
	},
}

Plex is the default Outtake palette.

View Source
var TokyoNight = Palette{
	ID:      PaletteTokyoNight,
	Name:    "Tokyo Night",
	Accent:  "#7AA2F7",
	Surface: "#1A1B26",
	Light: Scheme{
		Background:        "oklch(0.92 0.01 270)",
		Foreground:        "oklch(0.32 0.04 270)",
		Card:              "oklch(0.96 0.008 270)",
		Primary:           tokyoBlue,
		PrimaryForeground: "oklch(0.96 0.008 270)",
		Subtle:            "oklch(0.88 0.015 270)",
		MutedForeground:   "oklch(0.5 0.03 270)",
		Destructive:       "oklch(0.55 0.16 15)",
		Border:            "oklch(0.84 0.015 270)",
		Input:             "oklch(0.84 0.015 270)",
		Ring:              tokyoBlue,
		Sidebar:           "oklch(0.9 0.012 270)",
		SidebarPrimary:    tokyoBlue,
		SidebarAccent:     "oklch(0.86 0.015 270)",
	},
	Dark: Scheme{
		Background:        "oklch(0.226 0.021 280.487)",
		Foreground:        "oklch(0.846 0.061 274.763)",
		Card:              tokyoNight,
		Primary:           tokyoGlow,
		PrimaryForeground: tokyoNight,
		Subtle:            "oklch(0.306 0.037 273.227)",
		MutedForeground:   "oklch(0.65 0.04 274)",
		Destructive:       "oklch(0.7 0.14 12)",
		Border:            darkHairline,
		Input:             darkWell,
		Ring:              tokyoGlow,
		Sidebar:           tokyoNight,
		SidebarPrimary:    tokyoGlow,
		SidebarAccent:     "oklch(0.306 0.037 273.227)",
	},
}

TokyoNight is the Tokyo Night palette.

Functions

func CSS

func CSS() string

CSS renders :root/.dark for the default palette and data-palette overrides.

func IDList

func IDList() string

IDList returns palette IDs as a comma-separated html data-palettes value.

Types

type Palette

type Palette struct {
	ID      string
	Name    string
	Accent  string
	Surface string
	Light   Scheme
	Dark    Scheme
}

Palette is a named color theme with light and dark schemes.

func Palettes

func Palettes() []Palette

Palettes returns registered color themes, default first.

type Scheme

type Scheme struct {
	Background        string
	Foreground        string
	Card              string
	Primary           string
	PrimaryForeground string
	Subtle            string
	MutedForeground   string
	Destructive       string
	Border            string
	Input             string
	Ring              string
	Sidebar           string
	SidebarPrimary    string
	SidebarAccent     string
}

Scheme is the distinct colors for one appearance of a palette.

type Tokens

type Tokens struct {
	Background               string
	Foreground               string
	Card                     string
	CardForeground           string
	Popover                  string
	PopoverForeground        string
	Primary                  string
	PrimaryForeground        string
	Secondary                string
	SecondaryForeground      string
	Muted                    string
	MutedForeground          string
	Accent                   string
	AccentForeground         string
	Destructive              string
	Border                   string
	Input                    string
	Ring                     string
	Sidebar                  string
	SidebarForeground        string
	SidebarPrimary           string
	SidebarPrimaryForeground string
	SidebarAccent            string
	SidebarAccentForeground  string
	SidebarBorder            string
	SidebarRing              string
}

Tokens is the CSS custom properties for one appearance.

Jump to

Keyboard shortcuts

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