Color, style, and rich-text constants for the BB TUI dashboard.
Provides a consistent visual palette for the robot dashboard.
All functions are pure and return a color atom, an
%ExRatatui.Style{}, an %ExRatatui.Text.Span{}, or an
%ExRatatui.Text.Line{} โ never a side effect.
Rich text
brand_title/2- branded title-bar%Line{}("๐ค BB.TUI ยท MyApp.Robot @ remote@host")safety_badge/1- color-coded safety pill (armedgreen-bg,disarmeddim,disarmingyellow-bg,errorred-bg)key_pill/2- colored "key" pill%Span{}for status / help hintsdim_span/1- dim-text descriptor span between pillsfooter_line/1- assembles a%Line{}from a list of{keys, label}pairsproximity_color/1- foreground color for joint position bars based onBB.TUI.State.limit_proximity/2
Summary
Functions
Bold green style for armed state.
Style for blocked commands โ dark gray.
Blue for interactive elements and paths.
Returns focused or unfocused border style based on boolean.
Branded title-bar line โ ๐ค BB.TUI ยท MyApp.Robot[ @ node].
Cyan for timestamps and active panel borders.
Muted border color for inactive panels.
Dim span used between key pills.
Muted text for secondary information.
Dim style for disarmed state.
Bold yellow style for disarming state.
Bold red style for error state.
Cyan border style for the active/focused panel.
Builds a %Line{} of key_pill/2 + dim_span/1 pairs from a list
of {label, description} entries. Pass a {label, description, :quit} triple for the warning-red pill.
Style for the gauge filled portion โ green.
Style for the gauge unfilled portion โ dark gray.
Green for armed/safe states.
Highlight style for selected items.
Colored "key" pill โ keys render bold over a colored background, used in the status bar and help hints.
Magenta for parameter values and accents.
Returns the solid-pill badge spans for a panel title. The number
renders bold-black over a cyan background, mirroring the footer
keybind pills so the global 1..5 shortcuts are unmistakable in
the panel header. Returns an empty list when n is nil, so
callers can safely splat the result even for panels that aren't on
the cycle ring.
Bold style for panel title text, so the panel name stands shoulder
to shoulder with the solid number pill rendered by
panel_badge_spans/1.
Style for event path labels โ blue.
Foreground color for a joint position bar based on its limit
proximity (the value returned by BB.TUI.State.limit_proximity/2).
Bold style for ready commands โ green.
Red for error states.
Color-coded safety badge โ a single %Span{} pill that reads the
current safety state at a glance.
Style for simulated joint indicators โ yellow.
Deep Elixir/BB violet used as the title bar background.
Light lavender foreground used on top of the title bar background.
Dim border style for inactive panels.
Yellow for transitional states (disarming).
Functions
@spec armed_style() :: ExRatatui.Style.t()
Bold green style for armed state.
Examples
iex> style = BB.TUI.Theme.armed_style()
iex> style.fg
:green
iex> style.modifiers
[:bold]
@spec blocked_style() :: ExRatatui.Style.t()
Style for blocked commands โ dark gray.
Examples
iex> BB.TUI.Theme.blocked_style().fg
:dark_gray
@spec blue() :: ExRatatui.Style.color()
Blue for interactive elements and paths.
Examples
iex> BB.TUI.Theme.blue()
:blue
@spec border_style(boolean()) :: ExRatatui.Style.t()
Returns focused or unfocused border style based on boolean.
Examples
iex> BB.TUI.Theme.border_style(true) == BB.TUI.Theme.focused_border_style()
true
iex> BB.TUI.Theme.border_style(false) == BB.TUI.Theme.unfocused_border_style()
true
@spec brand_title(module(), node() | nil) :: ExRatatui.Text.Line.t()
Branded title-bar line โ ๐ค BB.TUI ยท MyApp.Robot[ @ node].
BB.TUI renders bold over title_fg/0; the robot module renders
bold cyan; the optional @ node segment trails in dim text.
Examples
iex> %ExRatatui.Text.Line{spans: spans} =
...> BB.TUI.Theme.brand_title(MyApp.Robot, nil)
iex> Enum.map(spans, & &1.content)
[" ๐ค ", "BB.TUI", " ยท ", "MyApp.Robot"]
iex> %ExRatatui.Text.Line{spans: spans} =
...> BB.TUI.Theme.brand_title(MyApp.Robot, :"robot@host")
iex> Enum.map_join(spans, "", & &1.content)
" ๐ค BB.TUI ยท MyApp.Robot @ robot@host"
@spec cyan() :: ExRatatui.Style.color()
Cyan for timestamps and active panel borders.
Examples
iex> BB.TUI.Theme.cyan()
:cyan
@spec dim_border() :: ExRatatui.Style.color()
Muted border color for inactive panels.
Examples
iex> BB.TUI.Theme.dim_border()
:dark_gray
@spec dim_span(String.t()) :: ExRatatui.Text.Span.t()
Dim span used between key pills.
Examples
iex> span = BB.TUI.Theme.dim_span(" panels")
iex> span.content
" panels"
iex> span.style.fg == BB.TUI.Theme.dim_text()
true
@spec dim_text() :: ExRatatui.Style.color()
Muted text for secondary information.
Examples
iex> BB.TUI.Theme.dim_text()
:dark_gray
@spec disarmed_style() :: ExRatatui.Style.t()
Dim style for disarmed state.
Examples
iex> style = BB.TUI.Theme.disarmed_style()
iex> style.fg
:dark_gray
@spec disarming_style() :: ExRatatui.Style.t()
Bold yellow style for disarming state.
Examples
iex> style = BB.TUI.Theme.disarming_style()
iex> style.fg
:yellow
iex> style.modifiers
[:bold]
@spec error_style() :: ExRatatui.Style.t()
Bold red style for error state.
Examples
iex> style = BB.TUI.Theme.error_style()
iex> style.fg
:red
iex> style.modifiers
[:bold]
@spec focused_border_style() :: ExRatatui.Style.t()
Cyan border style for the active/focused panel.
Examples
iex> BB.TUI.Theme.focused_border_style().fg
:cyan
@spec gauge_filled_style() :: ExRatatui.Style.t()
Style for the gauge filled portion โ green.
Examples
iex> BB.TUI.Theme.gauge_filled_style().fg
:green
@spec gauge_unfilled_style() :: ExRatatui.Style.t()
Style for the gauge unfilled portion โ dark gray.
Examples
iex> BB.TUI.Theme.gauge_unfilled_style().fg
:dark_gray
@spec green() :: ExRatatui.Style.color()
Green for armed/safe states.
Examples
iex> BB.TUI.Theme.green()
:green
@spec highlight_style() :: ExRatatui.Style.t()
Highlight style for selected items.
Examples
iex> style = BB.TUI.Theme.highlight_style()
iex> style.fg
:cyan
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 the status bar and help hints.
Pass :quit for the warning red pill (used for q); any other
atom uses the calm cyan pill.
Examples
iex> pill = BB.TUI.Theme.key_pill("Tab")
iex> pill.content
" Tab "
iex> pill.style.bg
:cyan
iex> pill = BB.TUI.Theme.key_pill("q", :quit)
iex> pill.style.bg
:red
iex> :bold in pill.style.modifiers
true
@spec magenta() :: ExRatatui.Style.color()
Magenta for parameter values and accents.
Examples
iex> BB.TUI.Theme.magenta()
:magenta
@spec panel_badge_spans(pos_integer() | nil) :: [ExRatatui.Text.Span.t()]
Returns the solid-pill badge spans for a panel title. The number
renders bold-black over a cyan background, mirroring the footer
keybind pills so the global 1..5 shortcuts are unmistakable in
the panel header. Returns an empty list when n is nil, so
callers can safely splat the result even for panels that aren't on
the cycle ring.
Examples
iex> [%ExRatatui.Text.Span{content: " "}, %ExRatatui.Text.Span{content: " 3 ", style: style}, %ExRatatui.Text.Span{content: " "}] =
...> BB.TUI.Theme.panel_badge_spans(3)
iex> style.bg
:cyan
iex> style.fg
:black
iex> :bold in style.modifiers
true
iex> BB.TUI.Theme.panel_badge_spans(nil)
[]
@spec panel_title_style() :: ExRatatui.Style.t()
Bold style for panel title text, so the panel name stands shoulder
to shoulder with the solid number pill rendered by
panel_badge_spans/1.
Examples
iex> BB.TUI.Theme.panel_title_style().modifiers
[:bold]
@spec path_style() :: ExRatatui.Style.t()
Style for event path labels โ blue.
Examples
iex> BB.TUI.Theme.path_style().fg
:blue
@spec proximity_color(atom()) :: ExRatatui.Style.color()
Foreground color for a joint position bar based on its limit
proximity (the value returned by BB.TUI.State.limit_proximity/2).
| proximity | color |
|---|---|
:normal | green |
:warning | yellow |
:danger | red |
Examples
iex> BB.TUI.Theme.proximity_color(:normal)
:green
iex> BB.TUI.Theme.proximity_color(:warning)
:yellow
iex> BB.TUI.Theme.proximity_color(:danger)
:red
@spec ready_style() :: ExRatatui.Style.t()
Bold style for ready commands โ green.
Examples
iex> BB.TUI.Theme.ready_style().fg
:green
@spec red() :: ExRatatui.Style.color()
Red for error states.
Examples
iex> BB.TUI.Theme.red()
:red
@spec safety_badge(atom()) :: ExRatatui.Text.Span.t()
Color-coded safety badge โ a single %Span{} pill that reads the
current safety state at a glance.
| state | bg | fg |
|---|---|---|
:armed | green | black |
:disarmed | none | dim |
:disarming | yellow | black |
:error | red | white |
Examples
iex> badge = BB.TUI.Theme.safety_badge(:armed)
iex> badge.content
" โ ARMED "
iex> badge.style.bg
:green
iex> badge = BB.TUI.Theme.safety_badge(:error)
iex> badge.content
" โ ERROR "
iex> badge.style.bg
:red
iex> BB.TUI.Theme.safety_badge(:disarmed).style.bg
nil
@spec sim_style() :: ExRatatui.Style.t()
Style for simulated joint indicators โ yellow.
Examples
iex> BB.TUI.Theme.sim_style().fg
:yellow
@spec title_bg() :: ExRatatui.Style.color()
Deep Elixir/BB violet used as the title bar background.
The hue is inspired by the Elixir logo and the Beam Bots hexdocs "purple" badge.
Examples
iex> BB.TUI.Theme.title_bg()
{:rgb, 78, 42, 90}
@spec title_fg() :: ExRatatui.Style.color()
Light lavender foreground used on top of the title bar background.
Examples
iex> BB.TUI.Theme.title_fg()
{:rgb, 230, 210, 245}
@spec unfocused_border_style() :: ExRatatui.Style.t()
Dim border style for inactive panels.
Examples
iex> BB.TUI.Theme.unfocused_border_style().fg
:dark_gray
@spec yellow() :: ExRatatui.Style.color()
Yellow for transitional states (disarming).
Examples
iex> BB.TUI.Theme.yellow()
:yellow