box_styles (cellium v0.1.0)

View Source

Box styles and rendering functions for various border types.

Summary

Functions

ascii2()

ascii()

ascii_double_head()

double()

double_edge()

draw_horizontal_line/6

draw_vertical_line/6

drawline(X, Y, Fg, Bg, Line, Buffer)

heavy()

heavy_edge()

heavy_head()

horizontals()

markdown()

minimal()

minimal_double_head()

minimal_heavy_head()

render_box(X, Y, Width, Height, BoxStyle, Title, TitleAlign, Fg, Bg, Buffer)

-spec render_box(integer(),
                 integer(),
                 integer(),
                 integer(),
                 #box{top_left :: term(),
                      top :: term(),
                      top_divider :: term(),
                      top_right :: term(),
                      head_left :: term(),
                      head_vertical :: term(),
                      head_right :: term(),
                      head_row_left :: term(),
                      head_row_horizontal :: term(),
                      head_row_cross :: term(),
                      head_row_right :: term(),
                      mid_left :: term(),
                      mid_vertical :: term(),
                      mid_right :: term(),
                      row_left :: term(),
                      row_horizontal :: term(),
                      row_cross :: term(),
                      row_right :: term(),
                      foot_row_left :: term(),
                      foot_row_horizontal :: term(),
                      foot_row_cross :: term(),
                      foot_row_right :: term(),
                      foot_left :: term(),
                      foot_vertical :: term(),
                      foot_right :: term(),
                      bottom_left :: term(),
                      bottom :: term(),
                      bottom_divider :: term(),
                      bottom_right :: term(),
                      is_ascii :: term()},
                 string() | binary(),
                 left | center | right,
                 atom(),
                 atom(),
                 map()) ->
                    map().

Renders a rectangular box with optional title in the top border.

This is a generic box renderer that handles simple rectangular boxes with optional title text interrupting the top border.

  • X: Starting X coordinate (left edge)
  • Y: Starting Y coordinate (top edge)
  • Width: Total width of the box (including borders)
  • Height: Total height of the box (including borders)
  • BoxStyle: Box style record defining border characters
  • Title: Optional title text (empty string or binary for no title)
  • TitleAlign: Title alignment (left | center | right)

  • Fg: Foreground color
  • Bg: Background color
  • Buffer: Current frame buffer
  • Returns: Updated buffer

rounded()

simple()

simple_head()

simple_heavy()

square()

square_double_head()