What to do about KColor?
zander at kde.org
Mon May 28 09:12:05 BST 2007
On Monday 28 May 2007 03:31:54 Andreas Pakulat wrote:
> On 28.05.07 02:36:37, Thiago Macieira wrote:
> > Andreas Pakulat wrote:
> > >b) everybody who wants to blend two colors now has to do 3 lines of
> > > code (as Matthew showed) instead of just one.
> > Non-issue.
> > More lines is better if it makes code more readable.
> Right, but I don't see how setting the Alpha on a Qcolor to make blend
> work properly makes the code more readable. I think that should be part
> of the implementation, all I as an API user want is to blend between
> two colors and give a ratio for that.
I, for one, think that its entirely natural that a color has an alpha
channel and thus that if you blend two colors that it would be odd and
unnatural to _also_ add an alpha to the argument list.
For most KDE / Qt programmers an alpha channel is new in version 4, but if
you come from a toolkit like Java this has existed for many years. So, I
can imagine that it takes a while to adjust to this change in concept.
Lets see if people find it a bit odd.
ps. you can use myColor.setAlphaF(double) to set a value between 0 and 1
so you don't have to know about the max = 255 thing.
-------------- next part --------------
A non-text attachment was scrubbed...
Name: not available
Size: 189 bytes
Desc: not available
More information about the kde-core-devel