Color, style, and rich-text constants for the TUI.
Provides a consistent visual palette based on the PhoenixGenApi brand
colors. All functions are pure and return a color tuple, an
%ExRatatui.Style{}, an %ExRatatui.Text.Span{}, or an
%ExRatatui.Text.Line{} โ never a side effect.
The palette is held internally as a single %ExRatatui.Theme{} struct;
the color accessors below read individual slots from it, and the border
styles delegate to ExRatatui.Theme.border_style/2.
Colors
phoenix_pink/0- PhoenixGenApi brand pink/magentacornflower/0- accent blue for focused bordersgold/0- highlight and selection colorhighlight_bg/0- subtle background for selected rowsdim_border/0- muted border color for unfocused panelsdim_text/0- muted text for secondary informationoverlay_bg/0- dark background for modal overlays
Composite Styles
highlight_style/0- bold gold text on dark background (selected items)focused_border_style/0- cornflower border (active panel)unfocused_border_style/0- dim border (inactive panel)border_style/1- convenience toggle between focused/unfocused
Rich Text
brand_title/1- branded header line ("๐ฅ PhoenixGenApi TUI Explorer ยท breadcrumb")resource_title/1- dim-service + bold-function line for the tabs blockkey_pill/2- colored "key" pill%Span{}for footer / help hintsdim_span/1- dim-text descriptor span between pillsfooter_line/1- assembles a%Line{}from a list of{keys, label}pairs
Summary
Functions
Returns focused_border_style/0 when focused? is true,
unfocused_border_style/0 otherwise.
Branded header line โ ๐ฅ PhoenixGenApi TUI Explorer with an optional breadcrumb.
Cornflower blue, used for focused panel borders.
Muted border color for unfocused panels.
Dim span used between key pills in the footer / help.
Muted text color for secondary information.
Cornflower blue border style for the active/focused panel.
Builds a footer %Line{} from a list of {label, description} pairs.
Gold, used for highlights and selected items.
Subtle dark background for selected rows.
Bold gold text on a dark background, used for selected items.
Colored "key" pill โ keys render bold over a colored background, used in footer and help hints.
Dark background for modal overlays.
PhoenixGenApi brand pink/magenta.
Title line for the detail (tabs) block โ the service prefix renders dim while the bare function name is bold gold.
Dim border style for inactive/unfocused panels.
Functions
@spec border_style(boolean()) :: ExRatatui.Style.t()
Returns focused_border_style/0 when focused? is true,
unfocused_border_style/0 otherwise.
Examples
iex> PhoenixGenApiTui.Theme.border_style(true) == PhoenixGenApiTui.Theme.focused_border_style()
true
iex> PhoenixGenApiTui.Theme.border_style(false) == PhoenixGenApiTui.Theme.unfocused_border_style()
true
@spec brand_title(String.t()) :: ExRatatui.Text.Line.t()
Branded header line โ ๐ฅ PhoenixGenApi TUI Explorer with an optional breadcrumb.
PhoenixGenApi renders in phoenix_pink/0 bold, TUI in gold/0 bold,
Explorer in white, and the breadcrumb in cornflower/0 bold separated
by a dim โ.
Examples
iex> %ExRatatui.Text.Line{spans: spans} = PhoenixGenApiTui.Theme.brand_title("")
iex> Enum.map(spans, & &1.content)
[" ๐ฅ ", "PhoenixGenApi", " ", "TUI", " ", "Explorer "]
iex> %ExRatatui.Text.Line{spans: spans} = PhoenixGenApiTui.Theme.brand_title("UserService")
iex> Enum.map_join(spans, "", & &1.content)
" ๐ฅ PhoenixGenApi TUI Explorer โ UserService "
@spec cornflower() :: ExRatatui.Style.color()
Cornflower blue, used for focused panel borders.
Examples
iex> PhoenixGenApiTui.Theme.cornflower()
{:rgb, 100, 149, 237}
@spec dim_border() :: ExRatatui.Style.color()
Muted border color for unfocused panels.
Examples
iex> PhoenixGenApiTui.Theme.dim_border()
{:rgb, 60, 60, 80}
@spec dim_span(String.t()) :: ExRatatui.Text.Span.t()
Dim span used between key pills in the footer / help.
Examples
iex> span = PhoenixGenApiTui.Theme.dim_span(" navigate")
iex> span.content
" navigate"
iex> span.style.fg == PhoenixGenApiTui.Theme.dim_text()
true
@spec dim_text() :: ExRatatui.Style.color()
Muted text color for secondary information.
Examples
iex> PhoenixGenApiTui.Theme.dim_text()
{:rgb, 150, 150, 170}
@spec focused_border_style() :: ExRatatui.Style.t()
Cornflower blue border style for the active/focused panel.
Examples
iex> style = PhoenixGenApiTui.Theme.focused_border_style()
iex> style.fg
{:rgb, 100, 149, 237}
@spec gold() :: ExRatatui.Style.color()
Gold, used for highlights and selected items.
Examples
iex> PhoenixGenApiTui.Theme.gold()
{:rgb, 255, 215, 0}
@spec highlight_bg() :: ExRatatui.Style.color()
Subtle dark background for selected rows.
Examples
iex> PhoenixGenApiTui.Theme.highlight_bg()
{:rgb, 40, 40, 60}
@spec highlight_style() :: ExRatatui.Style.t()
Bold gold text on a dark background, used for selected items.
Examples
iex> style = PhoenixGenApiTui.Theme.highlight_style()
iex> style.fg
{:rgb, 255, 215, 0}
iex> style.modifiers
[:bold]
@spec key_pill(String.t(), :default | :quit) :: ExRatatui.Text.Span.t()
Colored "key" pill โ keys render bold over a colored background, used in footer and help hints.
Pass :quit for the warning red pill (used for q); any other atom
uses the calm cyan pill.
Examples
iex> pill = PhoenixGenApiTui.Theme.key_pill("Tab")
iex> pill.style.bg
:cyan
iex> pill.content
" Tab "
iex> pill = PhoenixGenApiTui.Theme.key_pill("q", :quit)
iex> pill.style.bg
:red
iex> :bold in pill.style.modifiers
true
@spec overlay_bg() :: ExRatatui.Style.color()
Dark background for modal overlays.
Examples
iex> PhoenixGenApiTui.Theme.overlay_bg()
{:rgb, 20, 20, 30}
@spec phoenix_pink() :: ExRatatui.Style.color()
PhoenixGenApi brand pink/magenta.
Examples
iex> PhoenixGenApiTui.Theme.phoenix_pink()
{:rgb, 220, 50, 100}
@spec resource_title(String.t()) :: ExRatatui.Text.Line.t()
Title line for the detail (tabs) block โ the service prefix renders dim while the bare function name is bold gold.
Examples
iex> %ExRatatui.Text.Line{spans: spans} =
...> PhoenixGenApiTui.Theme.resource_title("MyApp.Services.UserService")
iex> Enum.map(spans, & &1.content)
[" ", "MyApp.Services.", "UserService", " "]
iex> %ExRatatui.Text.Line{spans: [_, _, name, _]} =
...> PhoenixGenApiTui.Theme.resource_title("Bare")
iex> name.content
"Bare"
iex> %ExRatatui.Text.Line{spans: [%{content: only}]} =
...> PhoenixGenApiTui.Theme.resource_title("")
iex> only
" No service selected "
@spec unfocused_border_style() :: ExRatatui.Style.t()
Dim border style for inactive/unfocused panels.
Examples
iex> style = PhoenixGenApiTui.Theme.unfocused_border_style()
iex> style.fg
{:rgb, 60, 60, 80}