From f22e75a0067000e741aac07b766e2d1c564631c4 Mon Sep 17 00:00:00 2001 From: Ruslan <79337999+ruslan-ilesik@users.noreply.github.com> Date: Thu, 5 Oct 2023 16:04:28 -0400 Subject: [PATCH] changed some if's to else if --- src/dpp/utility.cpp | 9 +++------ 1 file changed, 3 insertions(+), 6 deletions(-) diff --git a/src/dpp/utility.cpp b/src/dpp/utility.cpp index 703815def1..a650b64d3d 100644 --- a/src/dpp/utility.cpp +++ b/src/dpp/utility.cpp @@ -311,17 +311,14 @@ namespace dpp { const auto hue_to_rgb = [](double p, double q, double t){ if (t < 0) { t += 1; - } - if (t > 1) { + } else if (t > 1) { t -= 1; } if (t < 1.0 / 6.0) { return p + (q - p) * 6.0 * t; - } - if (t < 0.5) { + } else if (t < 0.5) { return q; - } - if (t < 2.0 / 3.0) { + } else if (t < 2.0 / 3.0) { return p + (q - p) * (2.0 / 3.0 - t) * 6.0; } return p;