Color, style, and rich-text constants for the TUI.
Provides a consistent visual palette based on the Ash Framework 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.
Colors
ash_orange/0- Ash brand orangecornflower/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 ("๐ฅ Ash TUI Explorer ยท breadcrumb")resource_title/1- dim-domain + bold-resource 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
Ash Framework brand orange.
Returns focused_border_style/0 when focused? is true,
unfocused_border_style/0 otherwise.
Branded header line โ ๐ฅ Ash 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.
Title line for the detail (tabs) block โ the domain prefix renders dim while the bare resource name is bold gold.
Dim border style for inactive/unfocused panels.
Functions
@spec ash_orange() :: ExRatatui.Style.color()
Ash Framework brand orange.
Examples
iex> AshTui.Theme.ash_orange()
{:rgb, 255, 107, 53}
@spec border_style(boolean()) :: ExRatatui.Style.t()
Returns focused_border_style/0 when focused? is true,
unfocused_border_style/0 otherwise.
Examples
iex> AshTui.Theme.border_style(true) == AshTui.Theme.focused_border_style()
true
iex> AshTui.Theme.border_style(false) == AshTui.Theme.unfocused_border_style()
true
@spec brand_title(String.t()) :: ExRatatui.Text.Line.t()
Branded header line โ ๐ฅ Ash TUI Explorer with an optional breadcrumb.
Ash renders in ash_orange/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} = AshTui.Theme.brand_title("")
iex> Enum.map(spans, & &1.content)
[" ๐ฅ ", "Ash", " ", "TUI", " ", "Explorer "]
iex> %ExRatatui.Text.Line{spans: spans} = AshTui.Theme.brand_title("User")
iex> Enum.map_join(spans, "", & &1.content)
" ๐ฅ Ash TUI Explorer โ User "
@spec cornflower() :: ExRatatui.Style.color()
Cornflower blue, used for focused panel borders.
Examples
iex> AshTui.Theme.cornflower()
{:rgb, 100, 149, 237}
@spec dim_border() :: ExRatatui.Style.color()
Muted border color for unfocused panels.
Examples
iex> AshTui.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 = AshTui.Theme.dim_span(" navigate")
iex> span.content
" navigate"
iex> span.style.fg == AshTui.Theme.dim_text()
true
@spec dim_text() :: ExRatatui.Style.color()
Muted text color for secondary information.
Examples
iex> AshTui.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 = AshTui.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> AshTui.Theme.gold()
{:rgb, 255, 215, 0}
@spec highlight_bg() :: ExRatatui.Style.color()
Subtle dark background for selected rows.
Examples
iex> AshTui.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 = AshTui.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 = AshTui.Theme.key_pill("Tab")
iex> pill.style.bg
:cyan
iex> pill.content
" Tab "
iex> pill = AshTui.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> AshTui.Theme.overlay_bg()
{:rgb, 20, 20, 30}
@spec resource_title(String.t()) :: ExRatatui.Text.Line.t()
Title line for the detail (tabs) block โ the domain prefix renders dim while the bare resource name is bold gold.
Examples
iex> %ExRatatui.Text.Line{spans: spans} =
...> AshTui.Theme.resource_title("AshDemo.Accounts.User")
iex> Enum.map(spans, & &1.content)
[" ", "AshDemo.Accounts.", "User", " "]
iex> %ExRatatui.Text.Line{spans: [_, _, name, _]} =
...> AshTui.Theme.resource_title("Bare")
iex> name.content
"Bare"
iex> %ExRatatui.Text.Line{spans: [%{content: only}]} =
...> AshTui.Theme.resource_title("")
iex> only
" No resource selected "
@spec unfocused_border_style() :: ExRatatui.Style.t()
Dim border style for inactive/unfocused panels.
Examples
iex> style = AshTui.Theme.unfocused_border_style()
iex> style.fg
{:rgb, 60, 60, 80}