diff --git a/include/Kyoto/Graphics/CColor.hpp b/include/Kyoto/Graphics/CColor.hpp index 66b0ae0c..0c86ba76 100644 --- a/include/Kyoto/Graphics/CColor.hpp +++ b/include/Kyoto/Graphics/CColor.hpp @@ -3,19 +3,23 @@ #include "types.h" +#pragma cpp_extensions on + class CColor { public: CColor(u32 col) : mRgba(col) {} - //CColor(float r, float g, float b, float a = 1.f) : mR(r * 255.f), mG(g * 255.f), mB(b * 255.f), mA(a * 255.f) {} + CColor(f32 r, f32 g, f32 b, f32 a = 1.f) : mR(r * 255.f), mG(g * 255.f), mB(b * 255.f), mA(a * 255.f) {} - static const CColor& Black(); static const CColor& White(); static const CColor& Grey(); static const CColor& Red(); + static const CColor& Green(); static const CColor& Blue(); static const CColor& Yellow(); + static const CColor& Purple(); static const CColor& Orange(); + private: union { struct { @@ -26,16 +30,16 @@ private: }; u32 mRgba; }; - - static const CColor sBlackColor; - static const CColor sWhiteColor; - static const CColor sGreyColor; - static const CColor sRedColor; - static const CColor sGreenColor; - static const CColor sBlueColor; - static const CColor sYellowColor; - static const CColor sPurpleColor; - static const CColor sOrangeColor; + + static const CColor sBlackColor; + static const CColor sWhiteColor; + static const CColor sGreyColor; + static const CColor sRedColor; + static const CColor sGreenColor; + static const CColor sBlueColor; + static const CColor sYellowColor; + static const CColor sPurpleColor; + static const CColor sOrangeColor; }; #endif // __CCOLOR_HPP__ diff --git a/src/Kyoto/Graphics/CColor.cpp b/src/Kyoto/Graphics/CColor.cpp index 286e26aa..0bad089e 100644 --- a/src/Kyoto/Graphics/CColor.cpp +++ b/src/Kyoto/Graphics/CColor.cpp @@ -14,6 +14,8 @@ const CColor& CColor::Black() { return sBlackColor; } const CColor& CColor::White() { return sWhiteColor; } const CColor& CColor::Grey() { return sGreyColor; } const CColor& CColor::Red() { return sRedColor; } +const CColor& CColor::Green() { return sGreenColor; } const CColor& CColor::Blue() { return sBlueColor; } const CColor& CColor::Yellow() { return sYellowColor; } +const CColor& CColor::Purple() { return sPurpleColor; } const CColor& CColor::Orange() { return sOrangeColor; }