diff options
author | Musab Kılıç <musabkilic@protonmail.com> | 2021-10-29 16:20:31 +0300 |
---|---|---|
committer | Andreas Kling <kling@serenityos.org> | 2021-11-02 12:20:48 +0100 |
commit | 4de7b3ad24209777d40445ed4e8b6ffcee5185b6 (patch) | |
tree | 435820f172f622302aa6c1a34a741733a3c8c8b0 /Userland/Applications/PixelPaint/Tools | |
parent | 686efb6737d28640354cc2b1c07d414b5ae076e6 (diff) | |
download | serenity-4de7b3ad24209777d40445ed4e8b6ffcee5185b6.zip |
PixelPaint: Map color_distance_squared from 0 to 1
Diffstat (limited to 'Userland/Applications/PixelPaint/Tools')
-rw-r--r-- | Userland/Applications/PixelPaint/Tools/BucketTool.cpp | 2 |
1 files changed, 1 insertions, 1 deletions
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) |