2015-07-13 20:15:37 -04:00
|
|
|
|
|
|
|
// Color.h
|
|
|
|
|
|
|
|
// Declares a class to handle item color related code
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
#pragma once
|
|
|
|
|
|
|
|
// tolua_begin
|
|
|
|
|
|
|
|
class cColor
|
|
|
|
{
|
|
|
|
public:
|
|
|
|
|
2015-07-21 16:25:37 -04:00
|
|
|
enum : unsigned int
|
2015-07-13 20:15:37 -04:00
|
|
|
{
|
|
|
|
COLOR_MIN = 0,
|
|
|
|
COLOR_MAX = 255,
|
|
|
|
COLOR_LIMIT = 256,
|
|
|
|
COLOR_NONE = 0xFFFFFFFF,
|
|
|
|
};
|
2015-07-29 11:04:03 -04:00
|
|
|
cColor() { m_Color = static_cast<unsigned int>(COLOR_NONE);}
|
2015-07-13 20:15:37 -04:00
|
|
|
cColor(unsigned char a_Red, unsigned char a_Green, unsigned char a_Blue) { SetColor(a_Red, a_Green, a_Blue); }
|
|
|
|
|
2015-09-17 05:20:10 -04:00
|
|
|
/** Returns whether the color is a valid color */
|
2015-07-13 20:15:37 -04:00
|
|
|
bool IsValid() const { return m_Color != COLOR_NONE; }
|
|
|
|
|
2015-09-17 05:20:10 -04:00
|
|
|
/** Changes the color */
|
2015-07-13 20:15:37 -04:00
|
|
|
void SetColor(unsigned char a_Red, unsigned char a_Green, unsigned char a_Blue);
|
|
|
|
|
2015-09-17 05:20:10 -04:00
|
|
|
/** Alters the red value of the color */
|
2015-07-13 20:15:37 -04:00
|
|
|
void SetRed(unsigned char a_Red);
|
|
|
|
|
2015-09-17 05:20:10 -04:00
|
|
|
/** Alters the green value of the color */
|
2015-07-13 20:15:37 -04:00
|
|
|
void SetGreen(unsigned char a_Red);
|
|
|
|
|
2015-09-17 05:20:10 -04:00
|
|
|
/** Alters the blue value of the color */
|
2015-07-13 20:15:37 -04:00
|
|
|
void SetBlue(unsigned char a_Red);
|
|
|
|
|
2015-09-17 05:20:10 -04:00
|
|
|
/** Returns the red value of the color */
|
2015-07-13 20:15:37 -04:00
|
|
|
unsigned char GetRed() const;
|
|
|
|
|
2015-09-17 05:20:10 -04:00
|
|
|
/** Returns the green value of the color */
|
2015-07-13 20:15:37 -04:00
|
|
|
unsigned char GetGreen() const;
|
|
|
|
|
2015-09-17 05:20:10 -04:00
|
|
|
/** Returns the blue value of the color */
|
2015-07-13 20:15:37 -04:00
|
|
|
unsigned char GetBlue() const;
|
|
|
|
|
2015-09-17 05:20:10 -04:00
|
|
|
/** Resets the color */
|
2015-07-29 11:04:03 -04:00
|
|
|
void Clear() { m_Color = static_cast<unsigned int>(COLOR_NONE); }
|
2015-07-13 20:15:37 -04:00
|
|
|
// tolua_end
|
|
|
|
|
|
|
|
unsigned int m_Color;
|
|
|
|
|
|
|
|
};
|