MiniEngine/SDLWrapper/RGBA.cpp

41 lines
498 B
C++
Raw Permalink Normal View History

2017-06-18 17:03:57 +08:00
#include "RGBA.h"
2017-07-31 00:18:10 +08:00
namespace MiniEngine
{
2017-06-18 17:03:57 +08:00
RGBA::RGBA(int R, int G, int B, int A)
{
r = R;
g = G;
b = B;
a = A;
}
RGBA::RGBA(ColorMode mode, int A)
{
r = mode.r;
g = mode.g;
b = mode.b;
a = A;
}
RGBA::RGBA()
{
r = g = b = a = 0;
}
SDL_Color RGBA::toSDLColor() const
{
SDL_Color c;
c.r = r;
c.g = g;
c.b = b;
c.a = a;
return c;
}
ColorMode RGBA::toColorMode() const
{
return ColorMode(r, g, b);
}
2017-07-31 00:18:10 +08:00
} /// End of namespace MiniEngine