mirror of
https://github.com/RGBCube/serenity
synced 2025-07-27 07:37:46 +00:00
LibGfx: Support alpha blending on gradients
This commit is contained in:
parent
cbc04a6285
commit
03037cbe4e
1 changed files with 2 additions and 2 deletions
|
@ -255,7 +255,7 @@ void Painter::fill_rect_with_gradient(Orientation orientation, IntRect const& a_
|
||||||
for (int j = 0; j < clipped_rect.width(); ++j) {
|
for (int j = 0; j < clipped_rect.width(); ++j) {
|
||||||
auto color = gamma_accurate_blend(gradient_start, gradient_end, c);
|
auto color = gamma_accurate_blend(gradient_start, gradient_end, c);
|
||||||
color.set_alpha(c_alpha);
|
color.set_alpha(c_alpha);
|
||||||
dst[j] = color.value();
|
dst[j] = Color::from_argb(dst[j]).blend(color).value();
|
||||||
c_alpha += alpha_increment;
|
c_alpha += alpha_increment;
|
||||||
c += 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);
|
auto color = gamma_accurate_blend(gradient_end, gradient_start, c);
|
||||||
color.set_alpha(c_alpha);
|
color.set_alpha(c_alpha);
|
||||||
for (int j = 0; j < clipped_rect.width(); ++j) {
|
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_alpha += alpha_increment;
|
||||||
c += increment;
|
c += increment;
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue