Skip to main content

sgr_color

Function sgr_color 

Source
pub fn sgr_color(color: Color, bg: bool) -> Option<String>
Expand description

The SGR parameter string for color in the foreground (bg: false) or background (bg: true) slot, or None for Color::Default (nothing to emit).

Codes follow ECMA-48 SGR (see this module’s file-level docs): 30/40 base for standard colors, 90/100 for bright, offset by the color index within its group of 8.