aboutsummaryrefslogtreecommitdiff
path: root/src/crepe/api/Color.cpp
diff options
context:
space:
mode:
authorLoek Le Blansch <loek@pipeframe.xyz>2024-10-24 10:52:21 +0200
committerLoek Le Blansch <loek@pipeframe.xyz>2024-10-24 10:52:21 +0200
commit39054829fa69bcfa2b468015dc3852a2f8deac9f (patch)
treee7726d90fb3c23a15919360dd10bdf709e7e087a /src/crepe/api/Color.cpp
parentdd9940720cde6975f79d65e08075687c47f0aec6 (diff)
parent5447ddd896eb49ea9fd9f9191a277fd1d5730aa3 (diff)
merge master into loek/config
Diffstat (limited to 'src/crepe/api/Color.cpp')
-rw-r--r--src/crepe/api/Color.cpp34
1 files changed, 34 insertions, 0 deletions
diff --git a/src/crepe/api/Color.cpp b/src/crepe/api/Color.cpp
new file mode 100644
index 0000000..fb5bd1a
--- /dev/null
+++ b/src/crepe/api/Color.cpp
@@ -0,0 +1,34 @@
+#include "Color.h"
+
+using namespace crepe::api;
+
+Color Color::white = Color(255, 255, 255, 0);
+Color Color::red = Color(255, 0, 0, 0);
+Color Color::green = Color(0, 255, 0, 0);
+Color Color::blue = Color(0, 0, 255, 0);
+Color Color::black = Color(0, 0, 0, 0);
+Color Color::cyan = Color(0, 255, 255, 0);
+Color Color::yellow = Color(255, 255, 0, 0);
+Color Color::magenta = Color(255, 0, 255, 0);
+
+// FIXME: do we really need double precision for color values?
+Color::Color(double red, double green, double blue, double alpha) {
+ this->a = alpha;
+ this->r = red;
+ this->g = green;
+ this->b = blue;
+};
+
+const Color & Color::get_white() { return Color::white; };
+
+const Color & Color::get_red() { return Color::red; };
+const Color & Color::get_green() { return Color::green; };
+const Color & Color::get_blue() { return Color::blue; };
+
+const Color & Color::get_black() { return Color::black; };
+
+const Color & Color::get_cyan() { return Color::cyan; };
+
+const Color & Color::get_yellow() { return Color::yellow; };
+
+const Color & Color::get_magenta() { return Color::magenta; };