add abstract color float
This commit is contained in:
parent
63cab9e476
commit
80585116ed
34
draw/Color.h
34
draw/Color.h
@ -33,6 +33,40 @@ namespace agg {
|
|||||||
namespace draw {
|
namespace draw {
|
||||||
typedef struct agg::rgba8 Color;
|
typedef struct agg::rgba8 Color;
|
||||||
|
|
||||||
|
class Colorf
|
||||||
|
{
|
||||||
|
public :
|
||||||
|
float r,g,b,a;
|
||||||
|
|
||||||
|
Colorf(void) :
|
||||||
|
r(0.0),
|
||||||
|
g(0.0),
|
||||||
|
b(0.0),
|
||||||
|
a(0.0)
|
||||||
|
{
|
||||||
|
|
||||||
|
}
|
||||||
|
Colorf(draw::Color& _input)
|
||||||
|
{
|
||||||
|
r = (float)_input.r / 255.0;
|
||||||
|
g = (float)_input.g / 255.0;
|
||||||
|
b = (float)_input.b / 255.0;
|
||||||
|
a = (float)_input.a / 255.0;
|
||||||
|
}
|
||||||
|
~Colorf(void)
|
||||||
|
{
|
||||||
|
|
||||||
|
}
|
||||||
|
Colorf & operator=(const draw::Color& _input)
|
||||||
|
{
|
||||||
|
r = (float)_input.r / 255.0;
|
||||||
|
g = (float)_input.g / 255.0;
|
||||||
|
b = (float)_input.b / 255.0;
|
||||||
|
a = (float)_input.a / 255.0;
|
||||||
|
return *this;
|
||||||
|
};
|
||||||
|
};
|
||||||
|
|
||||||
void ParseColor(const char* _input, struct agg::rgba8& color);
|
void ParseColor(const char* _input, struct agg::rgba8& color);
|
||||||
|
|
||||||
|
|
||||||
|
Loading…
x
Reference in New Issue
Block a user