|
||||||
|
||||||
Color Matrix Filter with ActionScript

Free
Flash Tutorial
Step Four: Matrix Settings - Multiply or Add
The values in the first four columns are multiplied with the source red, green, blue, and alpha values respectively. The fifth column value is added (offset).
To double the red place a 2 in the red row:
[2,0,0,0,0, /* Red */
0,1,0,0,0, /* Green */
0,0,1,0,0, /* Blue */
0,0,0,1,0 ]; /* Alpha Transparency */
Red has been doubled.
Instead I could use the offset to add a fixed amount of red. The maximum I can add is 255:
A hint of red.[0,0,0,0,80, /* Red */
0,1,0,0,0, /* Green */
0,0,0,0,0, /* Blue */
0,0,0,1,0 ]; /* Alpha Transparency */
Maximum red.[0,0,0,0,255, /* Red */
0,1,0,0,0, /* Green */
0,0,0,0,0, /* Blue */
0,0,0,1,0 ]; /* Alpha Transparency */
You can also add in color by increasing the alpha channel. Maximum is 1:
A hint of red.[1,0,0,0.4,0, /* Red */
0,1,0,0,0, /* Green */
0,0,0,0,0, /* Blue */
0,0,0,1,0 ]; /* Alpha Transparency */
Maximum red.[1,0,0,1,0, /* Red */
0,1,0,0,0, /* Green */
0,0,0,0,0, /* Blue */
0,0,0,1,0 ]; /* Alpha Transparency */
|
Why not try out webwasp's new community. Meet new people, find friends in your area: Webwasp Mates & Dates
•
7806 visitors to this page since
2 April 07 •
|
|
|
All material on this site is protected under international copyright © law. DO NOT reproduce any material from this site without written permission. Please ask as permission is often granted.
|