Set the background color of a cell in the grid. You must call draw() to see the change in the terminal.
0-based row index into grid
0-based column index into grid
6-bit RGB background color to set for the cell. Must be in range [0-63] inclusive.
Set the foreground color of a cell in the grid. You must call draw() to see the change in the terminal.
0-based row index into grid
0-based column index into grid
6-bit RGB foreground color to set for the cell. Must be in range [0-63] inclusive.
Set a cell in the grid. You must call draw() to see the change in the terminal.
0-based row index into grid
0-based column index into grid
character to set in cell
6-bit RGB foreground color to set for the cell. Must be in range [0-63] inclusive.
6-bit RGB background color to set for the cell. Must be in range [0-63] inclusive.
Set a sequence of cells of a row in the grid. Effects n cells where n is the length of text. You must call draw() to see the change in the terminal.
0-based row index into grid
0-based column index into grid
text to write in row y starting in column x
6-bit foreground color to set to each cell for the text. Must be in range [0-63] inclusive.
6-bit background color to set to each cell. Must be in range [0-63] inclusive.
Generated using TypeDoc
Represents the terminal as a 2D grid with 64 colors. Each cell has a foreground color fg, a background color bg and a unicode text character. Create an instance with the makeTermGrid factory function.
Typical usage might have a setup, a core function, and a shutdown.
Setup: the setup would call clear() to clean up the screen. Then attach an input event handler function with the onInput method. The handler should either be the core function or call the core function.
Core function: called for each input/other event. Example:
Shutdown: call reset() to return the terminal to normal.
A fg or bg color is a 6-bit RGB color from a 4x4x4 RGB color cube. A value in the range [0-63] inclusive. The bits in the number are RRGGBB. In other words, 2 bits per color component; in order red, green, then blue. For example if the color is 0b011011, then red is 1, green is 2 and blue is 3.