Themes
NAME
App::Moneymoor::Themes - the registry: every built-in palette, and the by-name loader the config file and the Settings dialog go through.
SYNOPSIS
use App::Moneymoor::Themes;
App::Moneymoor::Themes::all-names(); # the eleven, alphabetical
my $theme = App::Moneymoor::Themes::load('rose-pine');
# Spelling is forgiving, and an unknown name is not an error:
load('RosePine').name; # 'rose-pine'
load('rose_pine').name; # 'rose-pine'
load('chartreuse').name; # 'gruvbox' ā the default
DESCRIPTION
Eleven palettes, one loader. Separate from App::Moneymoor::Theme
(the data class) because the palette modules construct Theme
instances, and a registry living in the same file would close the
use cycle.
load never throws and never returns a type object. The name it is
given comes from a hand-editable config.json, and a palette is not
worth refusing to start the app over: an unrecognised name ā or one
with the wrong separator, or the wrong case ā resolves to Gruvbox.
Aliases exist for the spellings the schemes themselves use
(tokyonight, onedark, rosepine, solarized-dark,
catppuccin-mocha).
Why need, not use
Every palette module exports its own theme sub, so importing two of
them into one scope is a symbol collision ā and this module wants all
eleven. need loads a module without importing anything from it,
which is what lets load call each one by its fully-qualified name.
EXPORTS
all-names(--List)> ā the eleven canonical names, sorted, in the order the Settings picker shows them.load(Str:D $name --App::Moneymoor::Theme)> ā a palette, or Gruvbox.
SEE ALSO
App::Moneymoor::Theme ā what these return.
App::Moneymoor::Config ā where the configured name comes from.