summaryrefslogtreecommitdiff
path: root/src/helpers
diff options
context:
space:
mode:
authorvaxerski <43317083+vaxerski@users.noreply.github.com>2022-03-31 17:50:00 +0200
committervaxerski <43317083+vaxerski@users.noreply.github.com>2022-03-31 17:50:00 +0200
commit586e2a98ed9c48e2c22844782b6c7cf4fc1206e6 (patch)
treed4214a0917eaf04bdf1d6ede2f61fa0131e56c99 /src/helpers
parent993e60142477c1766f93fc2b2b8c064cf8370c57 (diff)
Added animated borders
Diffstat (limited to 'src/helpers')
-rw-r--r--src/helpers/Color.cpp24
-rw-r--r--src/helpers/Color.hpp15
2 files changed, 39 insertions, 0 deletions
diff --git a/src/helpers/Color.cpp b/src/helpers/Color.cpp
new file mode 100644
index 00000000..6b73b4d7
--- /dev/null
+++ b/src/helpers/Color.cpp
@@ -0,0 +1,24 @@
+#include "Color.hpp"
+#include "../defines.hpp"
+
+CColor::CColor() {
+
+}
+
+CColor::CColor(float r, float g, float b, float a) {
+ this->r = r;
+ this->g = g;
+ this->b = b;
+ this->a = a;
+}
+
+CColor::CColor(uint64_t hex) {
+ this->r = RED(hex) * 255.f;
+ this->g = GREEN(hex) * 255.f;
+ this->b = BLUE(hex) * 255.f;
+ this->a = ALPHA(hex) * 255.f;
+}
+
+uint64_t CColor::getAsHex() {
+ return ((int)a) * 0x1000000 + ((int)r) * 0x10000 + ((int)g) * 0x100 + ((int)b) * 0x1;
+} \ No newline at end of file
diff --git a/src/helpers/Color.hpp b/src/helpers/Color.hpp
new file mode 100644
index 00000000..7c0d30be
--- /dev/null
+++ b/src/helpers/Color.hpp
@@ -0,0 +1,15 @@
+#pragma once
+
+#include "../includes.hpp"
+
+class CColor {
+public:
+ CColor();
+ CColor(float, float, float, float);
+ CColor(uint64_t);
+
+ float r = 0, g = 0, b = 0, a = 255;
+
+ uint64_t getAsHex();
+
+}; \ No newline at end of file