Skip to main content

Module sgr

Module sgr 

Source
Expand description

SGR (Select Graphic Rendition) utility functions.

Extracted from backend.rs for reuse by the TUI diff engine and StructuredBackend. Provides combined SGR sequence emission and individual color parameter formatting.

Functionsยง

write_bg_params
Append background color parameters to an in-progress SGR sequence.
write_combined_sgr
Emit a single combined SGR sequence: \x1b[0;...m Resets all attributes then applies modifiers, fg, and bg in one escape.
write_fg_params
Append foreground color parameters to an in-progress SGR sequence. Color::Reset omitted (already handled by the leading 0 reset).