10 : r(std::clamp(R, 0.f, 1.f)) {}
13 bool operator==(
const ColorR& other)
const {
14 return this->r == other.r;
16 bool operator!=(
const ColorR& other)
const {
17 return !this->operator==(other);
25 : r(std::clamp(R, 0.f, 1.f))
26 , g(std::clamp(G, 0.f, 1.f)) {}
31 bool operator==(
const ColorRG& other)
const {
32 return this->r == other.r && this->g == other.g;
34 bool operator!=(
const ColorRG& other)
const {
35 return !this->operator==(other);
44 : r(std::clamp(R, 0.f, 1.f))
45 , g(std::clamp(G, 0.f, 1.f))
46 , b(std::clamp(B, 0.f, 1.f)) {}
51 bool operator==(
const ColorRGB& other)
const {
52 return this->r == other.r && this->g == other.g && this->b == other.b;
54 bool operator!=(
const ColorRGB& other)
const {
55 return !this->operator==(other);
64 ColorRGBA(
float R,
float G,
float B,
float A = 1.f)
65 : r(std::clamp(R, 0.f, 1.f))
66 , g(std::clamp(G, 0.f, 1.f))
67 , b(std::clamp(B, 0.f, 1.f))
68 , a(std::clamp(A, 0.f, 1.f)) {}
72 :
ColorRGBA(color.r, color.g, color.b, A) {}
75 bool operator==(
const ColorRGBA& other)
const {
76 return this->r == other.r && this->g == other.g && this->b == other.b && this->a == other.a;
78 bool operator!=(
const ColorRGBA& other)
const {
79 return !this->operator==(other);