KColor is coming this Monday...

Matthew Woehlke mw_triad at users.sourceforge.net
Sat May 26 01:05:11 BST 2007


Michael Pyne wrote:
> Zack's screenshot is pretty convincing [snip]

Well I would like to thank Zack for amply demonstrating the importance 
of API documentation. :-) And for making this demo so much easier to write.

Major problems with QColor::lighter/QColor::darker are...

WCT(Qt)S, it sure looks like darker() is lighter(100 - amt), or 
something along those lines. The main problem here is that I can't 
figure out how much a given color might need to be lightened by to get 
white; in KColor::lighten this is always 1.0. The Qt behavior 
(literally, multiplying luma/luminance by, erm, k, where k>1) is 
achievable with KColor::darken... using (drumroll please?) k>1. IOW 
KColor::darken(color, 1.5) == color.lighten(150).

Zack's screenshot looks "convincing" because he /asked/ KColor to tinker 
with the saturation as well as the luminance. Incidentally this is a 
KColor feature that QColor lacks. (Yes, I acknowledge that he probably 
did this because KColor isn't well documented yet.)

And for the grand finale, a demonstration of how QColor can't keep its 
hands off the saturation when you /don't/ want to play with it is 
attached. Note that the KColor bars do /not/ result in fully saturated 
colors when starting with a gray tone, whereas the QColor bars do. You 
can also note how the white point depends on the starting color with 
QColor, which is not true for KColor.

-- 
Matthew
"Still the prettiest." -- Legolas
(as quoted in The Very Secret Diaries by Cassandra Claire)
http://www.ealasaid.com/misc/vsd/
-------------- next part --------------
A non-text attachment was scrubbed...
Name: demo2.tar.bz2
Type: application/x-bzip2
Size: 5453 bytes
Desc: not available
URL: <http://mail.kde.org/pipermail/kde-core-devel/attachments/20070525/64eb7c6b/attachment.bin>
-------------- next part --------------
A non-text attachment was scrubbed...
Name: qcolor-bad.png
Type: image/png
Size: 5603 bytes
Desc: not available
URL: <http://mail.kde.org/pipermail/kde-core-devel/attachments/20070525/64eb7c6b/attachment.png>


More information about the kde-core-devel mailing list