diff --git a/examples/live.rs b/examples/live.rs index dfa374c..02e9e59 100644 --- a/examples/live.rs +++ b/examples/live.rs @@ -119,13 +119,15 @@ fn main() -> anyhow::Result<()> { } else { pixel = pixel_to_celcius(pixel); let cutoff = args.red_cutoff.unwrap(); - let r = if pixel > (256.0 * cutoff) as u16 { - 255 + let (r, g, b) = if pixel > (256.0 * cutoff) as u16 { + let p = pixel - (256.0 * cutoff) as u16; + let p = (p / 256).max(127); + ((128 + p) as u8, 0, 0) } else { - 0 + let g = frame[i * 2]; + let b = frame[i * 2 + 1]; + (0, g, b) }; - let g = frame[i * 2]; - let b = frame[i * 2 + 1]; let out_i = ((HEIGHT - 1 - y) + (WIDTH - 1 - x) * HEIGHT) * 4; swapped[out_i..out_i + 4].copy_from_slice(&[0, r, g, b]); }