mirror of
https://github.com/LadybirdBrowser/ladybird.git
synced 2025-09-06 17:48:37 +00:00
LibGfx: Support alpha blending on gradients
This commit is contained in:
parent
cbc04a6285
commit
03037cbe4e
Notes:
sideshowbarker
2024-07-17 08:51:45 +09:00
Author: https://github.com/MacDue
Commit: 03037cbe4e
Pull-request: https://github.com/SerenityOS/serenity/pull/14564
Reviewed-by: https://github.com/AtkinsSJ
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) {
|
||||
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;
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue