color_diff_cell

Function color_diff_cell 

Source
pub fn color_diff_cell(
    text: String,
    col: Column,
    delta: Option<f64>,
    delta_pct: Option<f64>,
    uptime_pct: Option<f64>,
    sort_by_delta: Option<f64>,
) -> Cell
Expand description

Color a diff-table cell based on its column type, the row’s raw delta (sign of color), and the row’s delta_pct (fraction for the bold threshold). Delta/% cells: yellow for positive (increase), magenta for negative (decrease). Uptime: green/yellow/red gradient. Other columns: default.

delta carries the raw metric delta — used only for color sign (positive vs negative). delta_pct carries the fractional delta (Δ / baseline) — used as the bold threshold on the Pct column. Without the split, the bold check |raw_delta| > 0.5 fired on every non-zero ns/byte change (ns and bytes are large; 0.5 trivially exceeded).