fix: fix rainbow animation for high frame numbers
This commit is contained in:
parent
11a929eec6
commit
f63fd2dff2
1 changed files with 1 additions and 1 deletions
|
@ -145,7 +145,7 @@ fn rainbow(layout: Layout, frame: u32) -> RgbImage {
|
||||||
|
|
||||||
RgbImage::from_fn(w, h, |x, y| {
|
RgbImage::from_fn(w, h, |x, y| {
|
||||||
let RGB { r, g, b } =
|
let RGB { r, g, b } =
|
||||||
HSV::from_f32((x + y + frame) as f32 / 100.0 % 1.0, 1.0, 0.1).to_rgb();
|
HSV::from_f32((x + y + frame % 100) as f32 / 100.0 % 1.0, 1.0, 0.1).to_rgb();
|
||||||
Rgb([(r * 255.0) as u8, (g * 255.0) as u8, (b * 255.0) as u8])
|
Rgb([(r * 255.0) as u8, (g * 255.0) as u8, (b * 255.0) as u8])
|
||||||
})
|
})
|
||||||
}
|
}
|
||||||
|
|
Loading…
Reference in a new issue