pub struct CellData<'a> { /* private fields */ }
Expand description
Data for a single terminal cell including character and colors.
CellData
represents the visual content of one terminal cell, including
the character to display and its foreground and background colors.
Colors are specified as RGB values packed into 32-bit integers.
§Color Format
Colors use the format 0xRRGGBB where:
- RR: Red component
- GG: Green component
- BB: Blue component
Implementations§
Source§impl<'a> CellData<'a>
impl<'a> CellData<'a>
Sourcepub fn new(
symbol: &'a str,
style: FontStyle,
effect: GlyphEffect,
fg: u32,
bg: u32,
) -> Self
pub fn new( symbol: &'a str, style: FontStyle, effect: GlyphEffect, fg: u32, bg: u32, ) -> Self
Creates new cell data with the specified character and colors.
§Parameters
symbol
- Character to display (should be a single character)style
- Font style for the character (e.g. bold, italic)effect
- Optional glyph effect (e.g. underline, strikethrough)fg
- Foreground color as RGB value (0xRRGGBB)bg
- Background color as RGB value (0xRRGGBB)
§Returns
New CellData
instance
Sourcepub fn new_with_style_bits(
symbol: &'a str,
style_bits: u16,
fg: u32,
bg: u32,
) -> Self
pub fn new_with_style_bits( symbol: &'a str, style_bits: u16, fg: u32, bg: u32, ) -> Self
Creates new cell data with pre-encoded style bits.
This is a lower-level constructor that accepts pre-encoded style bits rather than
separate FontStyle
and GlyphEffect
parameters. Use this when you have already
combined the style flags or when working directly with the bit representation.
§Parameters
symbol
- Character to displaystyle_bits
- Pre-encoded style flags. Must not overlap with base glyph ID bits (0x01FF). Valid bits include:0x0200
- Bold0x0400
- Italic0x0800
- Emoji (set automatically by the renderer for emoji glyphs)0x1000
- Underline0x2000
- Strikethrough
fg
- Foreground color as RGB value (0xRRGGBB)bg
- Background color as RGB value (0xRRGGBB)
§Returns
New CellData
instance
§Panics
Debug builds will panic if style_bits
contains any invalid bits.