Color visualization component for the terminal.
Provides multiple rendering modes:
- Native image (Kitty/iTerm2/Sixel): generates a real bitmap of the color wheel using the detected terminal protocol.
- ASCII half-block (universal fallback): renders a circle using Unicode
▀/▄characters with true-color ANSI (24-bit), yielding 2 pixels per vertical cell.
Detection is automatic — native rendering is attempted first and the component falls back to ASCII when the terminal does not support images.
Contracts
Este módulo usa los tipos definidos en Pote como fuente canónica.
Examples
alias Alaja.Components.ColorWheel
# Show color info
ColorWheel.show_color_info({255, 87, 51})
# Harmony ring
ColorWheel.show_harmony_ring({255, 0, 0}, :triad)
# Swatches
ColorWheel.show_swatches([{255, 0, 0}, {0, 255, 0}, {0, 0, 255}])
Summary
Functions
Computes the harmony colors for a given type and base RGB.
Extracts HSL hue angles from a list of RGB tuples.
Renders the ASCII color wheel and returns the lines (for layout composition).
Renders color format information as formatted terminal output.
Shows lighter/darker variants of a color.
Renders the color wheel as a PNG image and prints it to the terminal.
Renders a list of color swatches with hex labels.
Displays detailed color information: swatch, formats, and optional variants.
Shows a horizontal gradient between two colors.
Shows a harmony ring using ASCII rendering with autodetection of terminal capabilities. Falls back to ASCII half-block when the terminal does not support native image protocols.
Shows a list of colors as linear swatches.
Types
@type rgb() :: Pote.rgb()
Functions
Computes the harmony colors for a given type and base RGB.
Extracts HSL hue angles from a list of RGB tuples.
Renders the ASCII color wheel and returns the lines (for layout composition).
@spec render_color_formats(rgb()) :: :ok
Renders color format information as formatted terminal output.
@spec render_color_variants(rgb()) :: :ok
Shows lighter/darker variants of a color.
Renders the color wheel as a PNG image and prints it to the terminal.
This function generates a bitmap of the color wheel with harmony markers and outputs it using the detected image protocol (Kitty/iTerm2/Sixel).
Parameters
rgb_list- List of RGB tuples representing colors to mark on the wheelopts- Options (same asget_ascii_wheel_lines)
@spec render_swatch_list([rgb()]) :: :ok
Renders a list of color swatches with hex labels.
@spec show_color_info( Pote.Orchestrator.color_input(), keyword() ) :: :ok
Displays detailed color information: swatch, formats, and optional variants.
@spec show_gradient( Pote.Orchestrator.color_input(), Pote.Orchestrator.color_input(), pos_integer() ) :: :ok
Shows a horizontal gradient between two colors.
@spec show_harmony_ring(Pote.Orchestrator.color_input(), atom(), keyword()) :: :ok
Shows a harmony ring using ASCII rendering with autodetection of terminal capabilities. Falls back to ASCII half-block when the terminal does not support native image protocols.
@spec show_swatches( [Pote.Orchestrator.color_input()], keyword() ) :: :ok
Shows a list of colors as linear swatches.