Color manipulation functions in kdelibs?
Brad Hards
bradh at frogmouth.net
Sun Dec 10 00:54:40 GMT 2006
On Saturday 09 December 2006 08:27, Matthew Woehlke wrote:
> > QColor blendRGB(const QColor& c1, const QColor& c2, double k,
> > bool trunc=true)
<snip>
> > Blends between two colors in the specified color space. 'k' is the blend
> > factor, e.g. k=0 gives c1, k=1 gives c2. If 'trunc' is false, allow
> > values < 0 or > 1 (otherwise clamp to [0, 1]), e.g. blendRGB(Qt::gray,
> > Qt::white, -1, false) gives Qt::black, blendHSV(Qt::red, Qt::green, 2.0,
> > false) gives Qt::blue, etc.). If either color is Qt::white or Qt::black,
> > then HLS/HSV treat it as having H and S equal to the other color.
I would never have guessed that.
How about something like an enumeration that has a range of outputs options
like:
KColorBlend::limitBlendOutput, KColorBlend::extremeBlendOutput,
KColorBlend::accessibilityLowContrast; KColorBlend::accessibilityHighContrast
and so on. Then you use the right enumeration for the purpose you are trying
to achieve.
The k value should be called blendFactor in the declaration.
This might also be better placed in the QColor code - have you submitted a
wishlist item to the Trolls?
Brad
-------------- next part --------------
A non-text attachment was scrubbed...
Name: not available
Type: application/pgp-signature
Size: 189 bytes
Desc: not available
URL: <http://mail.kde.org/pipermail/kde-core-devel/attachments/20061210/add1cc71/attachment.sig>
-------------- next part --------------
_______________________________________________
kde-usability mailing list
kde-usability at kde.org
https://mail.kde.org/mailman/listinfo/kde-usability
More information about the kde-core-devel
mailing list