Unified color theme for the entire editor.
A theme holds every color the UI needs, organized into semantic groups:
syntax highlighting, editor chrome, modeline, gutter, picker, minibuffer,
search highlights, and popups. Built-in themes are functions that return
a populated %Theme{} struct.
Usage in config
use Minga.Config
set :theme, :catppuccin_mochaBuilt-in themes
:doom_one:catppuccin_frappe:catppuccin_latte:catppuccin_macchiato:catppuccin_mocha:one_dark:one_light
Summary
Types
RGB color as a non-negative integer (e.g., 0xFF6C6B).
A style keyword list compatible with MingaEditor.Frontend.Protocol.style().
Syntax theme: tree-sitter capture name → style.
Functions
Returns a syntax theme map customized for the agent chat buffer.
Returns the agent theme section, falling back to a basic default.
Returns all available theme name atoms (built-in + user-defined).
Returns the dashboard theme section, falling back to a basic default.
Returns the default theme name atom.
Returns the theme struct for the given name atom.
Returns the theme struct for the given name, raising on invalid name.
Registers user-defined themes loaded from disk.
Returns the style for a tree-sitter capture name, using suffix fallback.
Returns the map of registered user themes.
Types
@type color() :: non_neg_integer()
RGB color as a non-negative integer (e.g., 0xFF6C6B).
@type style() :: keyword()
A style keyword list compatible with MingaEditor.Frontend.Protocol.style().
Syntax theme: tree-sitter capture name → style.
@type t() :: %MingaEditor.UI.Theme{ agent: MingaEditor.UI.Theme.Agent.t() | nil, dashboard: MingaEditor.UI.Theme.Dashboard.t() | nil, editor: MingaEditor.UI.Theme.Editor.t(), git: MingaEditor.UI.Theme.Git.t(), gutter: MingaEditor.UI.Theme.Gutter.t(), minibuffer: MingaEditor.UI.Theme.Minibuffer.t(), modeline: MingaEditor.UI.Theme.Modeline.t(), name: atom(), picker: MingaEditor.UI.Theme.Picker.t(), popup: MingaEditor.UI.Theme.Popup.t(), search: MingaEditor.UI.Theme.Search.t(), syntax: syntax(), tab_bar: MingaEditor.UI.Theme.TabBar.t() | nil, tree: MingaEditor.UI.Theme.Tree.t() }
Functions
Returns a syntax theme map customized for the agent chat buffer.
Overrides delimiter and punctuation captures to use the agent theme's
delimiter_dim color, so tree-sitter naturally dims markdown syntax
characters (**, *, `, #, ```, brackets, list markers).
Link text uses link_fg and URLs use delimiter_dim.
The base syntax map comes from the editor's global theme; only the agent-specific overrides are merged on top.
@spec agent_theme(t()) :: MingaEditor.UI.Theme.Agent.t()
Returns the agent theme section, falling back to a basic default.
@spec available() :: [atom()]
Returns all available theme name atoms (built-in + user-defined).
@spec dashboard_theme(t()) :: MingaEditor.UI.Theme.Dashboard.t()
Returns the dashboard theme section, falling back to a basic default.
@spec default() :: atom()
Returns the default theme name atom.
Returns the theme struct for the given name atom.
Checks user-defined themes first, then built-in themes.
Returns the theme struct for the given name, raising on invalid name.
@spec register_user_themes(%{ required(atom()) => MingaEditor.UI.Theme.Loader.loaded_theme() }) :: :ok
Registers user-defined themes loaded from disk.
Called by the theme loader at startup and on reload. Stores themes
in :persistent_term for fast reads on the render path.
Returns the style for a tree-sitter capture name, using suffix fallback.
Tries exact match first. If not found, strips the last .segment and
retries. Returns [] if no match is found.
Examples
iex> theme = MingaEditor.UI.Theme.get!(:doom_one)
iex> style = MingaEditor.UI.Theme.style_for_capture(theme, "keyword")
iex> Keyword.get(style, :bold)
true
iex> theme = MingaEditor.UI.Theme.get!(:doom_one)
iex> MingaEditor.UI.Theme.style_for_capture(theme, "nonexistent")
[]
@spec user_themes() :: %{ required(atom()) => MingaEditor.UI.Theme.Loader.loaded_theme() }
Returns the map of registered user themes.