diff options
author | Tom <tomut@yahoo.com> | 2020-09-07 22:25:30 -0600 |
---|---|---|
committer | Andreas Kling <kling@serenityos.org> | 2020-09-08 10:45:35 +0200 |
commit | 607c78336be1aeb754419e24de4f4296add04fcd (patch) | |
tree | b8bf4469d305044966c5a45f952bca737a832bf5 /Libraries/LibGfx/Color.h | |
parent | c460f4a3cbe891225b528319f0a53dea7685d55c (diff) | |
download | serenity-607c78336be1aeb754419e24de4f4296add04fcd.zip |
LibGfx: Add ability to draw inverted rectangles
Diffstat (limited to 'Libraries/LibGfx/Color.h')
-rw-r--r-- | Libraries/LibGfx/Color.h | 7 |
1 files changed, 6 insertions, 1 deletions
diff --git a/Libraries/LibGfx/Color.h b/Libraries/LibGfx/Color.h index 619be7da05..c0c5eeed78 100644 --- a/Libraries/LibGfx/Color.h +++ b/Libraries/LibGfx/Color.h @@ -156,7 +156,12 @@ public: Color inverted() const { - return Color(~red(), ~green(), ~blue()); + return Color(~red(), ~green(), ~blue(), alpha()); + } + + Color xored(const Color& other) const + { + return Color(((other.m_value ^ m_value) & 0x00ffffff) | (m_value & 0xff000000)); } RGBA32 value() const { return m_value; } |