mirror of
https://github.com/RGBCube/serenity
synced 2025-07-28 05:27:45 +00:00
LibWeb+LibGfx: Move premultiplied alpha mixing to color.mixed_with()
This will be needed for mixing filters in LibGfx (and may be generally useful elsewhere).
This commit is contained in:
parent
ec4de1e07d
commit
7bc0c66290
3 changed files with 33 additions and 35 deletions
|
@ -235,6 +235,8 @@ public:
|
|||
#endif
|
||||
}
|
||||
|
||||
Color mixed_with(Color const& other, float weight) const;
|
||||
|
||||
Color interpolate(Color const& other, float weight) const noexcept
|
||||
{
|
||||
u8 r = red() + round_to<u8>(static_cast<float>(other.red() - red()) * weight);
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue