[Sc-devel] propose: Color-addons

Till Bovermann tboverma at techfak.uni-bielefeld.de
Wed Jul 25 12:40:10 PDT 2007


Would be nice to have these.
But I think it would be really great to have support for binaryOps  
(+, -, *, /), too...
For things like this:
	Color.rand + 0.1

On 24.07.2007, at 22:26, Fredrik Olofsson wrote:

> Till,
> so would this be our proposed fix to Color.sc then?
>
>         divide { arg aColor, opacity=1.0;
>                 var vals = aColor.asArray, d=0.0001 ! 3;
> -               ^Color.fromArray(blend(vals, (vals / (this.asArray  
> + d)).min(1.0), opacity) ++ alpha)
> +               ^Color.fromArray(blend(vals, ((this.asArray + d) /  
> vals).min(1.0), opacity) ++ alpha)
>         }
>         subtract { arg aColor, opacity=1.0;
>                 var vals = aColor.asArray;
> -               ^Color.fromArray(blend(vals, (vals -  
> this.asArray).max(0.0), opacity) ++ alpha)
> +               ^Color.fromArray(blend(vals, (this.asArray -  
> vals).max(0.0), opacity) ++ alpha)
>         }
>
>
>
> friends of course.  please forgive me if i sounded harsh and gave  
> you a hard time earlier today.

:-)

Till




More information about the Sc-devel mailing list