with_scaled_gradient

Function with_scaled_gradient 

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

Creates a custom scaled gradient that fits the filled portion width.

Combines custom color selection with dynamic gradient scaling. The gradient transitions from the first color to the second color across only the filled portion of the progress bar, creating an adaptive visual effect.

§Arguments

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

§Examples

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

let progress = new(&[
    with_scaled_gradient("#ee5a24".to_string(), "#feca57".to_string()),
]);

// The orange-to-yellow gradient will always span the filled portion,
// regardless of progress percentage