struct Termisu::Cell

Overview

Cell represents a single character cell in the terminal buffer.

Cell contains:

Example:

# Using named colors
cell = Termisu::Cell.new('A', fg: Color.green, bg: Color.black, attr: Attribute::Bold)

# Using 256-color palette
cell = Termisu::Cell.new('B', fg: Color.ansi256(208), bg: Color.ansi256(235))

# Using RGB/TrueColor
cell = Termisu::Cell.new('C', fg: Color.rgb(255, 128, 64), bg: Color.rgb(30, 30, 30))

Defined in:

termisu/cell.cr

Constructors

Instance Method Summary

Constructor Detail

def self.default : Cell #

Creates a default empty cell (space with default colors).


[View source]
def self.new(ch : Char = ' ', fg : Color = Color.white, bg : Color = Color.default, attr : Attribute = Attribute::None) #

Creates a new Cell with the specified character and colors.

Parameters:

  • ch: Unicode character to display
  • fg: Foreground color (default: white)
  • bg: Background color (default: default terminal color)
  • attr: Text attributes (default: None)

[View source]

Instance Method Detail

def ==(other : Cell) : Bool #

Checks if this cell equals another cell.


[View source]
def attr : Attribute #

[View source]
def attr=(attr : Attribute) #

[View source]
def bg : Color #

[View source]
def bg=(bg : Color) #

[View source]
def ch : Char #

[View source]
def ch=(ch : Char) #

[View source]
def fg : Color #

[View source]
def fg=(fg : Color) #

[View source]
def reset #

Resets the cell to default state (space, white on default background, no attributes).


[View source]