From 607c78336be1aeb754419e24de4f4296add04fcd Mon Sep 17 00:00:00 2001 From: Tom Date: Mon, 7 Sep 2020 22:25:30 -0600 Subject: LibGfx: Add ability to draw inverted rectangles --- Libraries/LibGfx/Color.h | 7 ++++++- 1 file changed, 6 insertions(+), 1 deletion(-) (limited to 'Libraries/LibGfx/Color.h') 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; } -- cgit v1.2.3