Does it need to be using ColorMatrixFilter ? I have a Tint utility class
that does exactly what you want but it's a simple color transform on a
MovieClip:

http://www.daroost.ca/download/Tint.as

It's in AS2 but I guess you could try and change it to work in AS3 ...

HTH

Alain

-----Original Message-----
From: [EMAIL PROTECTED]
[mailto:[EMAIL PROTECTED] On Behalf Of Mike
Mountain
Sent: 10 mai 2007 05:40
To: flashcoders@chattyfig.figleaf.com
Subject: Re: [Flashcoders] RGB tinting using the colorMatrixFilter()

not sure I made myself clear - given a desaturated greyscale image I need to
be able to tint it to an RGB value - so black stays black, white stays white
and rgb=128,128,228 (50% grey) is the actual colour - with all the shade in
between. I need to be able to do this by using code like this:

[as3]
    trace("composite startTime:"+getTimer());
    // tint
    var matrix:Array = new Array();
    matrix = matrix.concat([r1, r2, r3, r4, r5]);
    matrix = matrix.concat([g1, g2, g3, g4, g5]);
    matrix = matrix.concat([b1, b2, b3, b4, b5]);
    matrix = matrix.concat([a1, a2,a3, a4, a5]);
    var tintFilter = new ColorMatrixFilter(matrix); [/as3]

so how do I work out the r's g's and b's in the matrix?

Cheers

Mike
_______________________________________________
Flashcoders@chattyfig.figleaf.com
To change your subscription options or search the archive:
http://chattyfig.figleaf.com/mailman/listinfo/flashcoders

Brought to you by Fig Leaf Software
Premier Authorized Adobe Consulting and Training http://www.figleaf.com
http://training.figleaf.com


No virus found in this incoming message.
Checked by AVG Free Edition. 
Version: 7.5.467 / Virus Database: 269.6.6/795 - Release Date: 2007-05-09
15:07
 

No virus found in this outgoing message.
Checked by AVG Free Edition. 
Version: 7.5.467 / Virus Database: 269.6.6/795 - Release Date: 2007-05-09
15:07
 

_______________________________________________
Flashcoders@chattyfig.figleaf.com
To change your subscription options or search the archive:
http://chattyfig.figleaf.com/mailman/listinfo/flashcoders

Brought to you by Fig Leaf Software
Premier Authorized Adobe Consulting and Training
http://www.figleaf.com
http://training.figleaf.com

Reply via email to