diff --git a/src/graphics_api_impl.rs b/src/graphics_api_impl.rs index 8ce7196..c72b380 100644 --- a/src/graphics_api_impl.rs +++ b/src/graphics_api_impl.rs @@ -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 _,