Hyprland/src/helpers/Color.hpp

31 lines
675 B
C++
Raw Normal View History

2022-03-31 17:50:00 +02:00
#pragma once
#include "../includes.hpp"
class CColor {
public:
2022-03-31 17:50:00 +02:00
CColor();
CColor(float, float, float, float);
CColor(uint64_t);
float r = 0, g = 0, b = 0, a = 1.f;
2022-03-31 17:50:00 +02:00
uint64_t getAsHex();
2022-04-23 21:47:16 +02:00
CColor operator-(const CColor& c2) const {
return CColor(r - c2.r, g - c2.g, b - c2.b, a - c2.a);
2022-04-23 21:47:16 +02:00
}
CColor operator+(const CColor& c2) const {
2022-04-23 21:47:16 +02:00
return CColor(r + c2.r, g + c2.g, b + c2.b, a + c2.a);
}
CColor operator*(const float& v) const {
2022-04-23 21:47:16 +02:00
return CColor(r * v, g * v, b * v, a * v);
}
2022-09-25 20:07:48 +02:00
2022-05-12 11:27:31 +02:00
bool operator==(const CColor& c2) const {
return r == c2.r && g == c2.g && b == c2.b && a == c2.a;
}
2022-09-25 20:07:48 +02:00
};