View comments | RSS feed

Color matrix filter

The ColorMatrixFilter class is used to manipulate the color and alpha values of the filtered object. This allows you to create saturation changes, hue rotation (shifting a palette from one range of colors to another), luminance-to-alpha changes, and other color manipulation effects using values from one color channel and potentially applying them to other channels.

Conceptually, the filter goes through the pixels in the source image one by one and separates each pixel into its red, green, blue, and alpha components. It then multiplies values provided in the color matrix by each of these values, adding the results together to determine the resulting color value that will be displayed on the screen for that pixel. The matrix property of the filter is an array of 20 numbers that are used in calculating the final color. For details of the specific algorithm used to calculate the color values, see the entry describing the ColorMatrixFilter class's matrix property in the ActionScript 3.0 Language and Components Reference.

Further information and examples of the color matrix filter can be found in the article "Using Matrices for Transformations, Color Adjustments, and Convolution Effects in Flash" on the Adobe Developer Center web site.


Flash CS3


Comments


Rodislav said on Sep 4, 2007 at 6:34 AM :
Here is a link to an exemple that needs ActionScript 2 and Flash 8, why!? (Help is destinated for AS3, no!?)
adbe_paul said on Oct 11, 2007 at 3:03 PM :
Although the article was written in the Flash 8/ActionScript 2.0 timeframe, that particular part of ActionScript hasn't changed at all, so the concepts and examples in the article still apply equally to ActionScript 3.0.
Chad Schofield said on Nov 14, 2007 at 1:19 AM :
Here is the best explaination of this that I have found on the subject:
http://www.webwasp.co.uk/tutorials/218/tutorial.php

 

RSS feed | Send me an e-mail when comments are added to this page | Comment Report

Current page: http://livedocs.adobe.com/flash/9.0/main/00000205.html