From f7304c28c37d19658447a7754f068df0fe192134 Mon Sep 17 00:00:00 2001
From: Stefan Ravn van Overeem <StefanRvO@users.noreply.github.com>
Date: Thu, 17 Aug 2023 22:18:33 +0200
Subject: [PATCH] Fix Wshadow warning in Color::Interpolate (#727)

Co-authored-by: ArthurSonzogni <sonzogniarthur@gmail.com>
---
 src/ftxui/screen/color.cpp | 12 ++++++------
 1 file changed, 6 insertions(+), 6 deletions(-)

diff --git a/src/ftxui/screen/color.cpp b/src/ftxui/screen/color.cpp
index ed4442b6..41e28911 100644
--- a/src/ftxui/screen/color.cpp
+++ b/src/ftxui/screen/color.cpp
@@ -224,17 +224,17 @@ Color Color::Interpolate(float t, const Color& a, const Color& b) {
 
   // Gamma correction:
   // https://en.wikipedia.org/wiki/Gamma_correction
-  auto interp = [](uint8_t a, uint8_t b, float t) {
+  auto interp = [t](uint8_t a_u, uint8_t b_u) {
     constexpr float gamma = 2.2F;
-    const float a_f = powf(a, gamma);
-    const float b_f = powf(b, gamma);
+    const float a_f = powf(a_u, gamma);
+    const float b_f = powf(b_u, gamma);
     const float c_f = a_f * (1.0F - t) +  //
                       b_f * t;
     return static_cast<uint8_t>(powf(c_f, 1.F / gamma));
   };
-  return Color::RGB(interp(a_r, b_r, t),   //
-                    interp(a_g, b_g, t),   //
-                    interp(a_b, b_b, t));  //
+  return Color::RGB(interp(a_r, b_r),   //
+                    interp(a_g, b_g),   //
+                    interp(a_b, b_b));  //
 }
 
 inline namespace literals {
-- 
GitLab