I'm trying to make a shader that changes the color of a sprite the way the XNA spriteBatch.draw() color parameter changes color. I don't know exactly what it is called (the closest word I can think of is 'tinting' but that's not right I don't think) and it's kind of hard to explain the way it looks.
Say you set the parameter to 'Red' -- white pixels in the original texture would become completely red, while black pixels would remain black. Grey pixels would look dark red, blue pixels might look purple, green pixels might look brownish.
If you set the parameter to 'Black' the texture would become completely black.
Does anyone know the math behind this, or what this technique is called? It's probably very simple and I'm just not seeing it.