Skip to content

Commit

Permalink
Update crates/ecolor/src/color32.rs
Browse files Browse the repository at this point in the history
Co-authored-by: Emil Ernerfeldt <[email protected]>
  • Loading branch information
abey79 and emilk authored Jun 6, 2024
1 parent f65115f commit 0dcaba1
Showing 1 changed file with 4 additions and 4 deletions.
8 changes: 4 additions & 4 deletions crates/ecolor/src/color32.rs
Original file line number Diff line number Diff line change
Expand Up @@ -241,10 +241,10 @@ impl Color32 {
use emath::lerp;

Self::from_rgba_premultiplied(
lerp((self[0] as f32)..=(other[0] as f32), t).round() as u8,
lerp((self[1] as f32)..=(other[1] as f32), t).round() as u8,
lerp((self[2] as f32)..=(other[2] as f32), t).round() as u8,
lerp((self[3] as f32)..=(other[3] as f32), t).round() as u8,
fast_round(lerp((self[0] as f32)..=(other[0] as f32), t)),
fast_round(lerp((self[1] as f32)..=(other[1] as f32), t)),
fast_round(lerp((self[2] as f32)..=(other[2] as f32), t)),
fast_round(lerp((self[3] as f32)..=(other[3] as f32), t)),
)
}
}

0 comments on commit 0dcaba1

Please sign in to comment.