[Flashcoders] Get the average of 2 colors

2006-03-10 Thread Joakim Carlgren
Whats the easiest way to calculate the average of two colors? varcolor1:Number = 0xFF varcolor2:Number = 0xFF varmyColor:Color = new Color(my_mc) myColor.setRGB((color1 + color2) / 2) I know its not this simple and probably I need to play with bitwise

Re: [Flashcoders] Get the average of 2 colors

2006-03-10 Thread Helen Triolo
Probably the best thing would be to get the average for each channel individually and then combine them. I have an example of separate color channel manipulation (the old Color class way) at the bottom of this page http://flash-creations.com/notes/asclass_color.php if that helps. Helen --

Re: [Flashcoders] Get the average of 2 colors

2006-03-10 Thread Danny Kodicek
Whats the easiest way to calculate the average of two colors? Your answer sounds fine, given that there's not really a precise definition of the 'average of two colours'. But certainly if you were interpolating between colours, that's what you'd do. There are two main ways to combine

Re: [Flashcoders] Get the average of 2 colors

2006-03-10 Thread Janis Radins
Get my ColorTween class at www.mediaverk.lv/asd/com/jR/Math/ColorTween.as Then do the simple thing: import com.jR.Math.ColorTween; var midColor:Number = new ColorTween([0xFF, 0xFF]).getPoint(255/2); trace(0x+midColor.toString(16)) 2006/3/10, Joakim Carlgren [EMAIL PROTECTED]: Whats the

Re: [Flashcoders] Get the average of 2 colors

2006-03-10 Thread Wille Frankenhaeuser
Average the components or various colorchannels (red, green and blue) as stated earlier. Wille varcolor1:Number = 0xFF varcolor2:Number = 0xFF t_iBlend = blendComponents(color1, color2); showComponents(t_iBlend); function blendComponents(a_iColor1, a_iColor2){ t_ar_Color1

Re: [Flashcoders] Get the average of 2 colors

2006-03-10 Thread Danny Kodicek
Average the components or various colorchannels (red, green and blue) as stated earlier. Crap. That's what I meant, obviously. Writing without thinking. Got to stop doing that. Danny ___ Flashcoders@chattyfig.figleaf.com To change your

RE: [Flashcoders] Get the average of 2 colors

2006-03-10 Thread Joakim Carlgren
Thanks Janis...works great. Will take a closer look later. Kindly Joakim Carlgren -Original Message- From: [EMAIL PROTECTED] [mailto:[EMAIL PROTECTED] On Behalf Of Janis Radins Sent: den 10 mars 2006 15:17 To: Flashcoders mailing list Subject: Re: [Flashcoders] Get the average of 2

Re: [Flashcoders] Get the average of 2 colors

2006-03-10 Thread Janis Radins
To: Flashcoders mailing list Subject: Re: [Flashcoders] Get the average of 2 colors Get my ColorTween class at www.mediaverk.lv/asd/com/jR/Math/ColorTween.as Then do the simple thing: import com.jR.Math.ColorTween; var midColor:Number = new ColorTween([0xFF, 0xFF]).getPoint(255/2); trace(0x