Like Enduriel said, but in code form:

Code:
Color.g = (Color.r + Color.g + Color.b) / 3;
return(float4(0, Color.g, 0, 1));