From 746b1c92102ac22983255d981632c2d45d8e5c26 Mon Sep 17 00:00:00 2001 From: pajlada Date: Sun, 15 Jun 2025 11:10:59 +0200 Subject: [PATCH] fix(clang-tidy): modernize-use-std-numbers (#6270) --- src/singletons/Theme.cpp | 20 +++++++++++--------- 1 file changed, 11 insertions(+), 9 deletions(-) diff --git a/src/singletons/Theme.cpp b/src/singletons/Theme.cpp index a8453c9f..87eb07bb 100644 --- a/src/singletons/Theme.cpp +++ b/src/singletons/Theme.cpp @@ -20,6 +20,7 @@ #include #include +#include namespace { @@ -621,10 +622,11 @@ void Theme::normalizeColor(QColor &color) const if (color.lightnessF() > 0.4 && color.hueF() > 0.1 && color.hueF() < 0.33333) { - color.setHslF(color.hueF(), color.saturationF(), - color.lightnessF() - sin((color.hueF() - 0.1) / - (0.3333 - 0.1) * 3.14159) * - color.saturationF() * 0.4); + color.setHslF( + color.hueF(), color.saturationF(), + color.lightnessF() - sin((color.hueF() - 0.1) / (0.3333 - 0.1) * + std::numbers::pi) * + color.saturationF() * 0.4); } } else @@ -637,11 +639,11 @@ void Theme::normalizeColor(QColor &color) const if (color.lightnessF() < 0.6 && color.hueF() > 0.54444 && color.hueF() < 0.83333) { - color.setHslF( - color.hueF(), color.saturationF(), - color.lightnessF() + sin((color.hueF() - 0.54444) / - (0.8333 - 0.54444) * 3.14159) * - color.saturationF() * 0.4); + color.setHslF(color.hueF(), color.saturationF(), + color.lightnessF() + + sin((color.hueF() - 0.54444) / + (0.8333 - 0.54444) * std::numbers::pi) * + color.saturationF() * 0.4); } } }