Color themes for terminal diagram output.
Maps semantic style keys (:node, :edge, :arrow, etc.) to
IO.ANSI format sequences. Use built-in themes or define your own.
Built-in themes
:default— cyan nodes, yellow arrows, dim edges:mono— white/gray, no color:neon— magenta nodes, green arrows:dracula— purple/green on dark background:nord— cool blues and greens:amber— warm amber/gold tones:phosphor— green terminal aesthetic
Custom themes
my_theme = %Boxart.Theme{
node: [:blue],
edge: [:white],
arrow: [:red, :bright],
label: [:bright],
edge_label: [:faint, :italic]
}
Boxart.render(graph, theme: my_theme)
Summary
Functions
Returns a built-in theme by name.
Returns the ANSI format sequence for a style key.
Converts the theme to a map of style key => ANSI atoms. Useful for precomputing.
Types
@type ansi_style() :: [atom()]
@type t() :: %Boxart.Theme{ arrow: ansi_style(), dim: ansi_style(), edge: ansi_style(), edge_label: ansi_style(), label: ansi_style(), node: ansi_style(), subgraph: ansi_style(), subgraph_label: ansi_style() }
Functions
Returns a built-in theme by name.
@spec style_for(t(), String.t()) :: ansi_style()
Returns the ANSI format sequence for a style key.
@spec to_map(t()) :: %{required(String.t()) => ansi_style()}
Converts the theme to a map of style key => ANSI atoms. Useful for precomputing.