[graphics/krita] libs/ui/tool: Use KisPaintingTweaks::luminosityCoarse

Emmet O'Neill <[email protected]>
Newsgroups gmane.comp.kde.cvs
Message-ID <[email protected]>
Git commit 2416799832b274bbdd744e649906ba7edd97400d by Emmet O'Neill, on behalf of Dat Le.
Committed on 13/08/2026 at 23:16.
Pushed by emmetoneill into branch 'master'.

Use KisPaintingTweaks::luminosityCoarse

M  +3    -2    libs/ui/tool/KisAsyncColorSamplerHelper.cpp

https://invent.kde.org/graphics/krita/-/commit/2416799832b274bbdd744e649906ba7edd97400d

diff --git a/libs/ui/tool/KisAsyncColorSamplerHelper.cpp b/libs/ui/tool/KisAsyncColorSamplerHelper.cpp
index 95501e80e58..47535288abf 100644
--- a/libs/ui/tool/KisAsyncColorSamplerHelper.cpp
+++ b/libs/ui/tool/KisAsyncColorSamplerHelper.cpp
@@ -30,6 +30,7 @@
 #include "KisReferenceImagesDecoration.h"
 #include "kis_display_color_converter.h"
 #include "strokes/kis_color_sampler_stroke_strategy.h"
+#include "kis_painting_tweaks.h"
 
 
 namespace {
@@ -679,8 +680,8 @@ void KisAsyncColorSamplerHelper::paintCircle(QPainter &gc,
         // Draw crosshair if preview is offseted
         if (m_d->circlePreviewPosition != KisConfig::ColorSamplerPreviewCirclePosition::Center) {
             QColor crosshairColor = Qt::black;
-            // Apparently this fomular is outdated and inaccurate. But the accurate version require calculating power, probably overkill anyway
-            qreal luminance = (0.299 * currentColor.redF() + 0.587 * currentColor.greenF() + 0.114 * currentColor.blueF());
+            // TODO: Check back with Wolthera about the sRGB param
+            qreal luminance = KisPaintingTweaks::luminosityCoarse(currentColor, true);
             if (luminance < 0.5) crosshairColor = Qt::white;
 
             cachePainter.save();
lmpx.com only provides a reader for public news (NNTP) servers. It is not affiliated with the servers or forums shown here and is not responsible for the content of articles, which is written by their respective authors.