C++ (Qt)template <class R, class T>R combine_color(T c1, T c2, float w){ rgbLibF c1 = color_cast<rgbLibF>(clr1); rgbLibF c2 = color_cast<rgbLibF>(clr2); return color_cast<R>( c1 * (1 - w) + c2 * w ); }
C++ (Qt)rgbLibF c1, c2;float w;Color clr = combine_color(c1, c2, w);...Color c1, c2;rgbLibF clr2 = combine_color(c1, c2, w); и т.д..
C++ (Qt)return c1 * (1 - w) + c2 * w;
C++ (Qt)const Color operator*(Color c, float x){ rgbLibF clr = color_cast<rgbLibF>(c); return color_cast<Color>( clr * x );} const Color operator+(Color c1, Color c2){ return color_cast<Color>( color_cast<rgbLibF>(c1) + color_cast<rgbLibF>(c2) );}
C++ (Qt)Color operator = ( const rgbLibF & src );