Skip to main content

to_uncurses_style

Function to_uncurses_style 

Source
pub fn to_uncurses_style(s: Style) -> Style
Expand description

Convert a widget-library style into an uncurses style.

§Parameters

  • s - the source style. The conversion reads fg, bg, underline_color, and add_modifier.

§Returns

A CzStyle with foreground, background, and underline colors converted by to_uncurses_color. Additive modifiers map as follows: bold, dim, italic, slow blink, rapid blink, reversed, hidden, and crossed-out become the corresponding uncurses attribute flags. Underline becomes UnderlineStyle::Single when [Modifier::UNDERLINED] is present, and UnderlineStyle::None otherwise.

§Errors

This conversion is infallible.

§Panics

Does not panic.

§Usage note

sub_modifier is ignored. The backend converts concrete buffer cells, whose style has already been resolved by the widget library.