shader_type canvas_item;

uniform vec3 white = vec3(0.14, 0.13, 0.13);
uniform vec3 black = vec3(0.95, 0.55, 0.05);
uniform float gamma = 2.0;

vec3 bw_to_2color(vec3 c, vec3 dark, vec3 light)
{
    float l = pow(c.r * 0.2126 + c.g * 0.7152 + c.b * 0.0722, gamma);
    return mix(light, dark, l);
}


void fragment()
{
    COLOR.rgb = bw_to_2color(texture(TEXTURE, UV).rgb, white, black);
}
