summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorAndreas Kling <kling@serenityos.org>2020-06-13 20:03:19 +0200
committerAndreas Kling <kling@serenityos.org>2020-06-13 20:03:19 +0200
commit3bba163574c46589e514284b66a8db4fa8616c0c (patch)
tree13e459d1120c7778799959c4b736268278857f33
parent2650005af87d09c97af4d5a42033c1f6efbe9a3d (diff)
downloadserenity-3bba163574c46589e514284b66a8db4fa8616c0c.zip
LibGfx: Add Color::Transparent as a named color
-rw-r--r--Libraries/LibGfx/Color.cpp5
-rw-r--r--Libraries/LibGfx/Color.h1
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,