summaryrefslogtreecommitdiff
path: root/Userland/Libraries/LibGfx/Painter.cpp
diff options
context:
space:
mode:
authorMacDue <macdue@dueutil.tech>2022-07-12 00:34:56 +0100
committerSam Atkins <atkinssj@gmail.com>2022-07-17 20:11:38 +0100
commit03037cbe4e7d4e40d5c9e12a11f72376797994f2 (patch)
tree9b29b059007520186ae21d723c06c22970cd8c3e /Userland/Libraries/LibGfx/Painter.cpp
parentcbc04a6285a401d2858d93a25a12367f243ecb05 (diff)
downloadserenity-03037cbe4e7d4e40d5c9e12a11f72376797994f2.zip
LibGfx: Support alpha blending on gradients
Diffstat (limited to 'Userland/Libraries/LibGfx/Painter.cpp')
-rw-r--r--Userland/Libraries/LibGfx/Painter.cpp4
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;