mirror of
https://github.com/TombEngine/TombEngine.git
synced 2025-04-30 00:37:58 +03:00
57 lines
729 B
C++
57 lines
729 B
C++
![]() |
#include "framework.h"
|
||
|
#include "GameScriptColor.h"
|
||
|
|
||
|
GameScriptColor::GameScriptColor(byte r, byte g, byte b)
|
||
|
{
|
||
|
SetR(r);
|
||
|
SetG(g);
|
||
|
SetB(b);
|
||
|
}
|
||
|
|
||
|
GameScriptColor::GameScriptColor(byte r, byte g, byte b, byte a)
|
||
|
{
|
||
|
SetR(r);
|
||
|
SetG(g);
|
||
|
SetB(b);
|
||
|
SetA(a);
|
||
|
}
|
||
|
|
||
|
byte GameScriptColor::GetR()
|
||
|
{
|
||
|
return r;
|
||
|
}
|
||
|
|
||
|
void GameScriptColor::SetR(byte v)
|
||
|
{
|
||
|
r = std::clamp<byte>(v, 0, 255);
|
||
|
}
|
||
|
|
||
|
byte GameScriptColor::GetG()
|
||
|
{
|
||
|
return g;
|
||
|
}
|
||
|
|
||
|
void GameScriptColor::SetG(byte v)
|
||
|
{
|
||
|
g = std::clamp<byte>(v, 0, 255);
|
||
|
}
|
||
|
|
||
|
byte GameScriptColor::GetB()
|
||
|
{
|
||
|
return b;
|
||
|
}
|
||
|
|
||
|
void GameScriptColor::SetB(byte v)
|
||
|
{
|
||
|
b = std::clamp<byte>(v, 0, 255);
|
||
|
}
|
||
|
|
||
|
byte GameScriptColor::GetA()
|
||
|
{
|
||
|
return a;
|
||
|
}
|
||
|
|
||
|
void GameScriptColor::SetA(byte v)
|
||
|
{
|
||
|
a = std::clamp<byte>(v, 0, 255);
|
||
|
}
|