2019-12-11 00:51:42 -05:00
|
|
|
#pragma once
|
|
|
|
|
|
|
|
|
|
#include <stdint.h>
|
|
|
|
|
|
|
|
|
|
namespace PortabilityLayer
|
|
|
|
|
{
|
|
|
|
|
struct RGBAColor
|
|
|
|
|
{
|
2019-12-27 18:05:32 -05:00
|
|
|
uint8_t r, g, b, a;
|
|
|
|
|
|
2020-01-18 18:20:16 -05:00
|
|
|
bool operator==(const RGBAColor &other) const;
|
|
|
|
|
bool operator!=(const RGBAColor &other) const;
|
2019-12-27 18:05:32 -05:00
|
|
|
static RGBAColor Create(uint8_t r, uint8_t g, uint8_t b, uint8_t a);
|
|
|
|
|
};
|
|
|
|
|
|
|
|
|
|
inline RGBAColor RGBAColor::Create(uint8_t r, uint8_t g, uint8_t b, uint8_t a)
|
|
|
|
|
{
|
|
|
|
|
RGBAColor color;
|
|
|
|
|
color.r = r;
|
|
|
|
|
color.g = g;
|
|
|
|
|
color.b = b;
|
|
|
|
|
color.a = a;
|
|
|
|
|
|
|
|
|
|
return color;
|
2020-01-18 18:20:16 -05:00
|
|
|
}
|
|
|
|
|
|
|
|
|
|
inline bool RGBAColor::operator==(const RGBAColor &other) const
|
|
|
|
|
{
|
|
|
|
|
return this->r == other.r && this->g == other.g && this->b == other.b && this->a == other.a;
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
inline bool RGBAColor::operator!=(const RGBAColor &other) const
|
|
|
|
|
{
|
|
|
|
|
return !((*this) == other);
|
2019-12-27 18:05:32 -05:00
|
|
|
}
|
2019-12-11 00:51:42 -05:00
|
|
|
}
|