mirror of
https://github.com/fergalmoran/ladybird.git
synced 2026-01-06 16:45:03 +00:00
LibGfx: Add Color::multiply() for component wise multiplication
This commit is contained in:
committed by
Andreas Kling
parent
179dba652e
commit
e504d4ef96
@@ -159,6 +159,15 @@ public:
|
||||
#endif
|
||||
}
|
||||
|
||||
Color multiply(const Color& other) const
|
||||
{
|
||||
return Color(
|
||||
red() * other.red() / 255,
|
||||
green() * other.green() / 255,
|
||||
blue() * other.blue() / 255,
|
||||
alpha() * other.alpha() / 255);
|
||||
}
|
||||
|
||||
Color to_grayscale() const
|
||||
{
|
||||
int gray = (red() + green() + blue()) / 3;
|
||||
|
||||
Reference in New Issue
Block a user