diff --git a/src/bin/cnoise/main.rs b/src/bin/cnoise/main.rs index a3e3287..8a0a1f5 100644 --- a/src/bin/cnoise/main.rs +++ b/src/bin/cnoise/main.rs @@ -43,7 +43,13 @@ fn main() -> std::io::Result<()> { loop { let x = rng.gen_range(0, x_size); let y = rng.gen_range(0, y_size); - let c = c0.interpolate(c1, rng.gen::().powf(2.0)); + let c = { + if rng.gen::() < 0.5 { + c0.interpolate(c1, rng.gen::().powf(2.0)) + } else { + Color::black() + } + }; frame[y][x] = c; let mut buf = Vec::with_capacity(x_size * y_size * 3);