X-Git-Url: http://git.tdb.fi/?p=libs%2Fgl.git;a=blobdiff_plain;f=source%2Fcore%2Fcolor.h;h=999960ed7179147c8f8cefb293ee6d57720e336d;hp=e376e3308bfed081d9e192dfecc100d7047874bb;hb=HEAD;hpb=38712d8ecc57d043a2419ffbaeeb57f7a6586f14 diff --git a/source/core/color.h b/source/core/color.h index e376e330..999960ed 100644 --- a/source/core/color.h +++ b/source/core/color.h @@ -23,6 +23,7 @@ struct Color Color(float v): r(v), g(v), b(v) { } Color(float r_, float g_, float b_): r(r_), g(g_), b(b_) { } Color(float r_, float g_, float b_, float a_): r(r_), g(g_), b(b_), a(a_) { } + Color operator*(float f) const { return Color(r*f, g*f, b*f, a); } Color operator+(const Color &c) const { return Color(r+c.r, g+c.g, b+c.b, 1-(1-a)*(1-c.a)); } bool operator==(const Color &c) const { return (r==c.r && g==c.g && b==c.b && a==c.a); }