|
Aleph-w 3.0
A C++ Library for Data Structures and Algorithms
|
ANSI 24-bit colour palette for binary frames. More...
#include <ca-ascii.H>
Public Member Functions | |
| std::string | operator() (const State &value) const |
| Map a cell state to an ANSI-coloured glyph. | |
| std::size_t | glyph_width () const noexcept |
| Visible width of a single rendered cell, in columns. | |
Public Attributes | |
| State | dead {} |
| state considered dead | |
| RGB8 | dead_colour {20, 24, 28} |
| background colour for dead cells | |
| RGB8 | alive_colour {230, 245, 255} |
| background colour for live cells | |
| std::string | glyph = " " |
| glyph painted with the background | |
ANSI 24-bit colour palette for binary frames.
The returned string contains terminal escape codes and a reset sequence. It is intended for interactive terminals, not golden files.
| State | cell state type. |
Definition at line 118 of file ca-ascii.H.
|
inlinenoexcept |
Visible width of a single rendered cell, in columns.
The ANSI escape codes are zero-width on a real terminal, so the visible width equals glyph.size().
Definition at line 145 of file ca-ascii.H.
References Aleph::CA::Binary_ANSI24_Palette< State >::glyph.
|
inline |
Map a cell state to an ANSI-coloured glyph.
| [in] | value | cell value. |
Definition at line 129 of file ca-ascii.H.
References Aleph::CA::Binary_ANSI24_Palette< State >::alive_colour, Aleph::CA::RGB8::b, Aleph::CA::Binary_ANSI24_Palette< State >::dead, Aleph::CA::Binary_ANSI24_Palette< State >::dead_colour, Aleph::CA::RGB8::g, Aleph::CA::Binary_ANSI24_Palette< State >::glyph, out, Aleph::CA::RGB8::r, and value.
| RGB8 Aleph::CA::Binary_ANSI24_Palette< State >::alive_colour {230, 245, 255} |
background colour for live cells
Definition at line 122 of file ca-ascii.H.
Referenced by Aleph::CA::Binary_ANSI24_Palette< State >::operator()().
| State Aleph::CA::Binary_ANSI24_Palette< State >::dead {} |
state considered dead
Definition at line 120 of file ca-ascii.H.
Referenced by Aleph::CA::Binary_ANSI24_Palette< State >::operator()().
| RGB8 Aleph::CA::Binary_ANSI24_Palette< State >::dead_colour {20, 24, 28} |
background colour for dead cells
Definition at line 121 of file ca-ascii.H.
Referenced by Aleph::CA::Binary_ANSI24_Palette< State >::operator()().
| std::string Aleph::CA::Binary_ANSI24_Palette< State >::glyph = " " |
glyph painted with the background
Definition at line 123 of file ca-ascii.H.
Referenced by Aleph::CA::Binary_ANSI24_Palette< State >::glyph_width(), and Aleph::CA::Binary_ANSI24_Palette< State >::operator()().