From 4de7b3ad24209777d40445ed4e8b6ffcee5185b6 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Musab=20K=C4=B1l=C4=B1=C3=A7?= Date: Fri, 29 Oct 2021 16:20:31 +0300 Subject: PixelPaint: Map color_distance_squared from 0 to 1 --- Userland/Applications/PixelPaint/Tools/BucketTool.cpp | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) (limited to 'Userland/Applications/PixelPaint/Tools') diff --git a/Userland/Applications/PixelPaint/Tools/BucketTool.cpp b/Userland/Applications/PixelPaint/Tools/BucketTool.cpp index 84cca7c386..162db6df2c 100644 --- a/Userland/Applications/PixelPaint/Tools/BucketTool.cpp +++ b/Userland/Applications/PixelPaint/Tools/BucketTool.cpp @@ -34,7 +34,7 @@ static float color_distance_squared(Gfx::Color const& lhs, Gfx::Color const& rhs int a = rhs.red() - lhs.red(); int b = rhs.green() - lhs.green(); int c = rhs.blue() - lhs.blue(); - return (a * a + b * b + c * c) / (255.0f * 255.0f); + return (a * a + b * b + c * c) / (3.0f * 255.0f * 255.0f); } static void flood_fill(Gfx::Bitmap& bitmap, Gfx::IntPoint const& start_position, Color target_color, Color fill_color, int threshold) -- cgit v1.2.3