blend function urgently needed in kdelibs

Matthew Woehlke mw_triad at
Mon May 21 20:31:45 BST 2007

kdelibs desperately needs a color blending function. I am volunteering 
(yet again) to provide one that looks like this:

KColor blend(const KColor& c1, const KColor& c2,
              double k = 0.5, double r = 0.5, SPEC cs = CS_RGB,
              int flags = BLEND_NORMAL, int cmask = 0x0000FFFF);

Can someone PLEASE suggest where I can put such a thing? (Due to lack of 
prior response, if I don't hear back by next Monday I'm going to /pick/ 
somewhere and people can bitch about it.)

The default arguments will result in k% c1 plus (1-k)% c2 (i.e. "normal" 
blending) ...but it is extensible and BC to nearly anything.

No, KColor is not a typo; I want HSV and HSY support (I'll subclass 
QColor if possible, otherwise will make conversion as painless as I 
can.) Actually KColor::blend would be convenient anyway, so that would 
make the question 'where to put KColor'.

When in doubt, duct tape!

More information about the kde-core-devel mailing list