2022-03-31 17:50:00 +02:00
|
|
|
#pragma once
|
|
|
|
|
2023-02-27 13:32:38 +01:00
|
|
|
#include <cstdint>
|
2024-12-03 19:58:24 +01:00
|
|
|
#include <hyprgraphics/color/Color.hpp>
|
|
|
|
#include "../debug/Log.hpp"
|
|
|
|
#include "../macros.hpp"
|
2022-03-31 17:50:00 +02:00
|
|
|
|
2024-12-03 19:58:24 +01:00
|
|
|
class CHyprColor {
|
2022-12-16 18:17:31 +01:00
|
|
|
public:
|
2024-12-03 19:58:24 +01:00
|
|
|
CHyprColor();
|
|
|
|
CHyprColor(float r, float g, float b, float a);
|
|
|
|
CHyprColor(const Hyprgraphics::CColor& col, float a);
|
|
|
|
CHyprColor(uint64_t);
|
2022-03-31 17:50:00 +02:00
|
|
|
|
2024-09-30 01:57:51 +02:00
|
|
|
// AR32
|
2024-12-03 19:58:24 +01:00
|
|
|
uint32_t getAsHex() const;
|
|
|
|
Hyprgraphics::CColor::SSRGB asRGB() const;
|
|
|
|
Hyprgraphics::CColor::SOkLab asOkLab() const;
|
|
|
|
Hyprgraphics::CColor::SHSL asHSL() const;
|
|
|
|
CHyprColor stripA() const;
|
|
|
|
|
|
|
|
//
|
|
|
|
bool operator==(const CHyprColor& c2) const {
|
|
|
|
return c2.r == r && c2.g == g && c2.b == b && c2.a == a;
|
2022-04-23 21:47:16 +02:00
|
|
|
}
|
|
|
|
|
2024-12-03 19:58:24 +01:00
|
|
|
// stubs for the AnimationMgr
|
|
|
|
CHyprColor operator-(const CHyprColor& c2) const {
|
|
|
|
RASSERT(false, "CHyprColor: - is a STUB");
|
|
|
|
return {};
|
2022-04-23 21:47:16 +02:00
|
|
|
}
|
|
|
|
|
2024-12-03 19:58:24 +01:00
|
|
|
CHyprColor operator+(const CHyprColor& c2) const {
|
|
|
|
RASSERT(false, "CHyprColor: + is a STUB");
|
|
|
|
return {};
|
2022-04-23 21:47:16 +02:00
|
|
|
}
|
2022-09-25 20:07:48 +02:00
|
|
|
|
2024-12-03 19:58:24 +01:00
|
|
|
CHyprColor operator*(const float& c2) const {
|
|
|
|
RASSERT(false, "CHyprColor: * is a STUB");
|
|
|
|
return {};
|
2022-05-12 11:27:31 +02:00
|
|
|
}
|
2023-11-11 01:52:40 +01:00
|
|
|
|
2024-12-03 19:58:24 +01:00
|
|
|
double r = 0, g = 0, b = 0, a = 0;
|
|
|
|
|
|
|
|
private:
|
|
|
|
Hyprgraphics::CColor::SOkLab okLab; // cache for the OkLab representation
|
2022-09-25 20:07:48 +02:00
|
|
|
};
|