From 8790b2e0c60aa3a2b3cd912da97dd49816f744d6 Mon Sep 17 00:00:00 2001 From: ABUCKY0 <81783950+ABUCKY0@users.noreply.github.com> Date: Mon, 25 Mar 2024 23:04:57 -0500 Subject: [PATCH] Probably Not Fix, Will Test Later --- src/LedLib/LedLib.cpp | 16 +++++++++++++--- 1 file changed, 13 insertions(+), 3 deletions(-) diff --git a/src/LedLib/LedLib.cpp b/src/LedLib/LedLib.cpp index 9689a9e..3352480 100644 --- a/src/LedLib/LedLib.cpp +++ b/src/LedLib/LedLib.cpp @@ -143,11 +143,21 @@ namespace LedLib RGB LedLib::lerpRGB(RGB color1, RGB color2, double scale) { RGB lerpedColor; - lerpedColor.red = static_cast(color1.red * (1.0 - scale) + color2.red * scale); - lerpedColor.green = static_cast(color1.green * (1.0 - scale) + color2.green * scale); - lerpedColor.blue = static_cast(color1.blue * (1.0 - scale) + color2.blue * scale); + lerpedColor.red = color1.red * (1.0 - scale) + color2.red * scale; + lerpedColor.green = color1.green * (1.0 - scale) + color2.green * scale; + lerpedColor.blue = color1.blue * (1.0 - scale) + color2.blue * scale; return lerpedColor; } + + /** + * @brief Interpolate 2 HSV values based on a given scale. + * + * @param color1 The first color to interpolate from + * @param color2 The second color to interpolate to + * @param scale The scale to interpolate by (0.0 - 1.0) + * + * @return A HSV struct + */ HSV LedLib::lerpHSV(HSV color1, HSV color2, double scale) { HSV interpolatedColor;