diff options
author | MacDue <macdue@dueutil.tech> | 2022-07-12 00:34:56 +0100 |
---|---|---|
committer | Sam Atkins <atkinssj@gmail.com> | 2022-07-17 20:11:38 +0100 |
commit | 03037cbe4e7d4e40d5c9e12a11f72376797994f2 (patch) | |
tree | 9b29b059007520186ae21d723c06c22970cd8c3e /Userland/Libraries/LibGfx | |
parent | cbc04a6285a401d2858d93a25a12367f243ecb05 (diff) | |
download | serenity-03037cbe4e7d4e40d5c9e12a11f72376797994f2.zip |
LibGfx: Support alpha blending on gradients
Diffstat (limited to 'Userland/Libraries/LibGfx')
-rw-r--r-- | Userland/Libraries/LibGfx/Painter.cpp | 4 |
1 files changed, 2 insertions, 2 deletions
diff --git a/Userland/Libraries/LibGfx/Painter.cpp b/Userland/Libraries/LibGfx/Painter.cpp index b5b67e50d6..ef277a5878 100644 --- a/Userland/Libraries/LibGfx/Painter.cpp +++ b/Userland/Libraries/LibGfx/Painter.cpp @@ -255,7 +255,7 @@ void Painter::fill_rect_with_gradient(Orientation orientation, IntRect const& a_ for (int j = 0; j < clipped_rect.width(); ++j) { auto color = gamma_accurate_blend(gradient_start, gradient_end, c); color.set_alpha(c_alpha); - dst[j] = color.value(); + dst[j] = Color::from_argb(dst[j]).blend(color).value(); c_alpha += alpha_increment; c += increment; } @@ -268,7 +268,7 @@ void Painter::fill_rect_with_gradient(Orientation orientation, IntRect const& a_ auto color = gamma_accurate_blend(gradient_end, gradient_start, c); color.set_alpha(c_alpha); for (int j = 0; j < clipped_rect.width(); ++j) { - dst[j] = color.value(); + dst[j] = Color::from_argb(dst[j]).blend(color).value(); } c_alpha += alpha_increment; c += increment; |