Remove TODO & add explanation

master^2
Alex Bethel 2021-11-29 17:39:44 -07:00
parent 8927d905ac
commit 9c30c1098c
1 changed files with 4 additions and 3 deletions

View File

@ -133,10 +133,11 @@ impl AglApi for GraphicsRenderer {
}
}
/// Interpolate between two colors according to a factor.
/// Linearly interpolate between two colors according to a factor.
/// This method is cheap, perfectly accurate for shades of gray, and
/// reasonably accurate for other colors; if better results are
/// needed, LCH interpolation should be used instead.
fn lerp_rgba(a: RGBA, b: RGBA, fac: f32) -> RGBA {
// TODO: This is probably the wrong way to mix colors, but it's
// simple and works for now.
RGBA {
r: ((b.r as f32 - a.r as f32) * fac + a.r as f32) as _,
g: ((b.g as f32 - a.g as f32) * fac + a.g as f32) as _,