Remove TODO & add explanation

This commit is contained in:
Alex Bethel 2021-11-29 17:39:44 -07:00
parent 4adb0cfda7
commit d3a1ffbef1

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 _,