Function with_gradient

Source
pub fn with_gradient(color_a: String, color_b: String) -> ProgressOption
Expand description

Creates a custom gradient fill blending between two specified colors.

The gradient transitions smoothly from the first color to the second color across the width of the progress bar. Colors can be specified as hex codes (e.g., “#ff0000”) or named colors supported by your terminal.

§Arguments

  • color_a - The starting color of the gradient
  • color_b - The ending color of the gradient

§Examples

use bubbletea_widgets::progress::{new, with_gradient};

// Red to blue gradient
let progress = new(&[
    with_gradient("#ff0000".to_string(), "#0000ff".to_string()),
]);

// Green to yellow gradient
let warm_progress = new(&[
    with_gradient("#10ac84".to_string(), "#f9ca24".to_string()),
]);