mirror of
https://github.com/LadybirdBrowser/ladybird.git
synced 2024-11-22 23:50:19 +00:00
PixelPaint: Map color_distance_squared from 0 to 1
This commit is contained in:
parent
686efb6737
commit
4de7b3ad24
Notes:
sideshowbarker
2024-07-18 01:37:11 +09:00
Author: https://github.com/musabkilic Commit: https://github.com/SerenityOS/serenity/commit/4de7b3ad242 Pull-request: https://github.com/SerenityOS/serenity/pull/10679
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 a = rhs.red() - lhs.red();
|
||||||
int b = rhs.green() - lhs.green();
|
int b = rhs.green() - lhs.green();
|
||||||
int c = rhs.blue() - lhs.blue();
|
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)
|
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