gleamtea/progress

A bubble: a horizontal progress bar with an electric gradient.

Types

An opaque progress-bar value.

pub type Progress

Values

pub fn incr(delta: Float, bar: Progress) -> Progress

Add delta to the current fraction (clamped).

pub fn new(width width: Int) -> Progress

A progress bar with the given width (in columns), using the default Charm gradient (purple → pink).

pub fn percent(bar: Progress) -> Float

The current fraction, 0.01.0.

pub fn set(fraction: Float, bar: Progress) -> Progress

Set the fill fraction, clamped to [0.0, 1.0].

pub fn view(bar: Progress) -> String

Render the bar (with a trailing percentage).

pub fn with_gradient(
  width width: Int,
  from from: #(Int, Int, Int),
  to to: #(Int, Int, Int),
) -> Progress

A progress bar whose fill fades between two 24-bit truecolor endpoints from and to, each an #(r, g, b) triple (new in beamtea 0.1.2).

Search Document