SurfaceCells
Namespace: Hex1b.Surfaces
Assembly: Hex1b.dll
Provides commonly used values.
public static class SurfaceCellsInheritance
Object → SurfaceCells
Methods
Char(char, Hex1bColor?, Hex1bColor?, CellAttributes)
Creates a cell containing a single character with optional styling.
Parameters:
character(Char): The character to display.foreground(Nullable<Hex1bColor>): The foreground color, or null for transparent.background(Nullable<Hex1bColor>): The background color, or null for transparent.attributes(CellAttributes): Text styling attributes.
Returns: SurfaceCell
A new with the specified properties.
public static SurfaceCell Char(char character, Hex1bColor? foreground = null, Hex1bColor? background = null, CellAttributes attributes = CellAttributes.None)Grapheme(string, Hex1bColor?, Hex1bColor?, CellAttributes, int)
Creates a cell containing a grapheme cluster with optional styling.
Parameters:
grapheme(String): The grapheme cluster (may be multiple code points for emoji, combining chars, etc.).foreground(Nullable<Hex1bColor>): The foreground color, or null for transparent.background(Nullable<Hex1bColor>): The background color, or null for transparent.attributes(CellAttributes): Text styling attributes.displayWidth(Int32): The display width of the grapheme (1 for normal, 2 for wide).
Returns: SurfaceCell
A new with the specified properties.
public static SurfaceCell Grapheme(string grapheme, Hex1bColor? foreground = null, Hex1bColor? background = null, CellAttributes attributes = CellAttributes.None, int displayWidth = 1)Space(Hex1bColor?, Hex1bColor?)
Creates a space cell with the specified foreground and background colors.
Parameters:
foreground(Nullable<Hex1bColor>): The foreground color.background(Nullable<Hex1bColor>): The background color.
Returns: SurfaceCell
A space cell with the specified colors.
public static SurfaceCell Space(Hex1bColor? foreground, Hex1bColor? background)Space(Hex1bColor?)
Creates a space cell with the specified background color. Useful for clearing regions with a specific background.
Parameters:
background(Nullable<Hex1bColor>): The background color.
Returns: SurfaceCell
A space cell with the specified background.
public static SurfaceCell Space(Hex1bColor? background)Fields
Continuation
A continuation cell used for wide character support. When a wide character (like emoji or CJK) spans multiple columns, subsequent columns contain this cell to indicate they are covered by the preceding wide character.
Returns: SurfaceCell
public static readonly SurfaceCell ContinuationEmpty
An empty/unwritten cell with no content and no colors (fully transparent). This is the default cell used to initialize surfaces. During compositing, cells equal to this are skipped to allow lower layers to show through. During output, any remaining unwritten cells are rendered as spaces.
Returns: SurfaceCell
public static readonly SurfaceCell EmptyRemarks
Using these static instances avoids repeated allocations for common cell types. Since is a value type (record struct), these don't save memory directly, but they provide convenient constants and enable reference equality checks in certain optimization scenarios.