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
--
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
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
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
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
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
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
7 matches
Mail list logo