Skip to main content

progress_bar

Function progress_bar 

Source
pub fn progress_bar(
    pct: i32,
    fill_color: &str,
    theme: &Theme,
    marker_pct: Option<i32>,
) -> String
Expand description

Build a fixed-width progress bar in Pango markup.

  • pct is clamped to 0..=100.
  • fill_color colors the filled () cells; theme.bar_empty colors the empty () cells.
  • If marker_pct is Some, a single in theme.marker color is placed at the corresponding cell, displacing one empty cell and (when usage exceeds the marker position) splitting the filled run around it.

Implementation note: this mirrors claudebar:225-250’s two-branch logic but in a single expression. The resulting markup is byte-identical for the same inputs.