uniform sampler2D	texture_unit;

uniform float4		fill_color;
uniform float4		outline_color;

uniform	float4		gradient_from;
uniform float4		gradient_to;

float4 main(float4 position : TEXCOORD0) : COLOR0
{
	float4 pixel = tex2D(texture_unit, position.xy);
	
	float4 outcol;
	
	float4 g_color = lerp(gradient_from, gradient_to, pixel.r);
	
	outcol.rgb = (g_color * pixel.b) + (outline_color * pixel.g);
	
	if (pixel.b == 0.0)
		outcol.a = 0.0;
	else
		outcol.a = pixel.a;
	
	return outcol;
}
