mirror of
https://github.com/SerenityOS/serenity.git
synced 2025-01-22 17:31:58 -05:00
PixelPaint: Map color_distance_squared from 0 to 1
This commit is contained in:
parent
686efb6737
commit
4de7b3ad24
1 changed files with 1 additions and 1 deletions
|
@ -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)
|
||||
|
|
Loading…
Reference in a new issue