Add color tint effect with colour matrix

1.1k Views Asked by At

I am trying to add a filter to change the colour of something to a dark green, like you can add the style 'Tint' in Flash and then set alpha and rgb.

I have tried adding a colour matrix filter and have managed to get a fluorescent green, but can't see how to make it a dark green. I don't understand colour matrixes very well so I'm not sure if it is even possible.

I am using the pixi javascript library, but I think colour matrixes are a pretty standard thing.

Any help would be greatly appreciated!

This is the matrix which gets fluorescent green:

            0, 0, 0, 0,
            0, 1, 0, 1,
            0, 0, 0, 0,
            0, 0, 0, 0
1

There are 1 best solutions below

0
On

I don't use Pixi but you tagged Flash so..
If your system supports -minus values you could try this as a starting point

  //R,   G,     B,    A 
  0.0,   0.0,   0.0,  0,  //Red
 -0.5,  -0.5,  -0.5,  1,  //Green
  0.0,   0.0,   0.0,  0,  //Blue
  0.0,   0.0,   0.0,  1   //Alpha (= always 1 for visibilty


In a colour matrix you control //Green but you can add/mult/subtract hints of another channels using the R.G.B.A values at the top (which are multiplied not plused together anyway for the final colour. Here you are saying Green must be 1 (full opacity) and then -0.5 * -0.5 * 0.5.


Experiment with a colour photograph of a limited palette to get the hang of colourmatrix and how it affects pixel colours.