C++ (Qt)typedef union { unsigned int value; struct { unsigned char a, r, g, b; } argb;} Color;
C++ (Qt)T c1, c2;float weight; ...return c1 * (1 - weight) + с2 * weight;
C++ (Qt)const Color operator*(Color c, float x) { ...} const Color operator*(float x, Color x){ ...}
C++ (Qt)const Color operator*( Color c, float x ) { Color res; res.argb.r = float( c.argb.r ) * x; res.argb.g = float( c.argb.g ) * x; res.argb.b = float( c.argb.b ) * x; return res;}
C++ (Qt)struct rgbF { friend rgbF operator + ( const rgbF & c, const rgbF & c ); float r, g, b;};
C++ (Qt)rgbF operator * ( const Color & c, float t );
C++ (Qt)template <class R, class T>R some_color_function(T clr1, T clr2);
C++ (Qt)return c1 * (1 - weight) + с2 * weight;