diff options
author | Andreas Kling <kling@serenityos.org> | 2020-06-13 20:03:19 +0200 |
---|---|---|
committer | Andreas Kling <kling@serenityos.org> | 2020-06-13 20:03:19 +0200 |
commit | 3bba163574c46589e514284b66a8db4fa8616c0c (patch) | |
tree | 13e459d1120c7778799959c4b736268278857f33 | |
parent | 2650005af87d09c97af4d5a42033c1f6efbe9a3d (diff) | |
download | serenity-3bba163574c46589e514284b66a8db4fa8616c0c.zip |
LibGfx: Add Color::Transparent as a named color
-rw-r--r-- | Libraries/LibGfx/Color.cpp | 5 | ||||
-rw-r--r-- | Libraries/LibGfx/Color.h | 1 |
2 files changed, 6 insertions, 0 deletions
diff --git a/Libraries/LibGfx/Color.cpp b/Libraries/LibGfx/Color.cpp index 59f596ce21..0b4f5f0c8b 100644 --- a/Libraries/LibGfx/Color.cpp +++ b/Libraries/LibGfx/Color.cpp @@ -40,6 +40,11 @@ namespace Gfx { Color::Color(NamedColor named) { + if (named == Transparent) { + m_value = 0; + return; + } + struct { u8 r; u8 g; diff --git a/Libraries/LibGfx/Color.h b/Libraries/LibGfx/Color.h index 1af7ecfbbd..d58d546584 100644 --- a/Libraries/LibGfx/Color.h +++ b/Libraries/LibGfx/Color.h @@ -49,6 +49,7 @@ struct HSV { class Color { public: enum NamedColor { + Transparent, Black, White, Red, |