2015-03-21 15:51 GMT+01:00 Eliot Miranda <eliot.miranda@gmail.com>:Why not take the average of alpha in all cases?
Eliot (phone)Or weight the argument by its alpha and don't change the alpha of the receiver:Color white - (Color white alpha:0) = Color whiteColor 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 canused instead.As the arithmetic operations on Color doesn't work (for years?), maybe we should removethe operation now, and replace them with a more verbose apiaddRGB/ addRGBA/ subRGBA ....nicolai
��On Sat, Mar 21, 2015 at 3:41 AM, Ben Coman <btc@openinworld.com> 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.Slice is in inbox (15188)
- 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)
Cheers,Alex