prime/include/Kyoto/Text/CTextColor.hpp

41 lines
680 B
C++
Raw Normal View History

#ifndef _CTEXTCOLOR
#define _CTEXTCOLOR
2022-09-30 04:24:13 +00:00
#include <types.h>
2023-01-11 22:03:38 +00:00
#ifdef __MWERKS__
#pragma cpp_extensions on
#endif
2022-09-30 04:24:13 +00:00
class CTextColor {
public:
CTextColor(uchar r, uchar g, uchar b, uchar a) : mR(r), mG(g), mB(b), mA(a) {}
2023-01-11 22:03:38 +00:00
CTextColor(const CTextColor& other) : mR(other.mR), mG(other.mG), mB(other.mB), mA(other.mA) {}
const CTextColor& operator=(const CTextColor& other) {
mR = other.mR;
mG = other.mG;
mB = other.mB;
mA = other.mA;
return *this;
}
2022-09-30 04:24:13 +00:00
private:
2023-01-11 22:03:38 +00:00
union {
struct {
uchar mR;
uchar mG;
uchar mB;
uchar mA;
};
uint mRgba;
};
2022-09-30 04:24:13 +00:00
};
2023-01-11 22:03:38 +00:00
#ifdef __MWERKS__
#pragma cpp_extensions off
#endif
#endif // _CTEXTCOLOR