2015-03-21 15:51 GMT+01:00 Eliot Miranda <[email protected]>: > Why not take the average of alpha in all cases? > > Eliot (phone) > > On Mar 21, 2015, at 6:32 AM, Aliaksei Syrel <[email protected]> wrote: >
Or weight the argument by its alpha and don't change the alpha of the receiver: Color white - (Color white alpha:0) = Color white Color white - (Color white alpha:0.5) = Color gray. Color white - (Color white alpha:1.0) = Color black. For what do you need the color arithmetic ? Maybe there are already other operations defined on Color that you can used instead. As the arithmetic operations on Color doesn't work (for years?), maybe we should remove the operation now, and replace them with a more verbose api addRGB/ addRGBA/ subRGBA .... nicolai > > > On Sat, Mar 21, 2015 at 3:41 AM, Ben Coman <[email protected]> wrote: > >> Do we need to do something for Pharo 4? And what is the simplest/quickest >> thing that would work - even if it needs revisiting in Pharo 5? > > > The most simple that works is to at least set alpha to any value. > > - Multiplication - alpha doesn't change > - Division - alpha doesn't change > - Addition - (color1 apha + color2 alpha) min: 1.0 - simple addition > and check to not allow alpha to overcome max value > - Subtraction - if two colors are the same alpha becomes 0, otherwise > we take alpha of message receiver (minuend) > > Slice is in inbox (15188) > > Cheers, > Alex > >
