No need to reply, just made this thread to help @steady storm.
shader_type canvas_item;
// Set this from a script.
uniform float percent: hint_range(0, 100) = 50.;
uniform float line_scale: hint_range(0.000001, .5) = 50.;
uniform vec4 line_color: source_color;
void vertex() {}
void fragment() {
float vertical = 1. - UV.y; // Black to white vertical gradient
float threshold = (.01 * percent); // Convert [0,100] percentage to [0,1] threshold
float difference = abs(threshold - vertical);
float line_amount = step(difference / line_scale, 1.);
vec3 color = COLOR.rgb;
float grayscale = (color.r + color.g + color.b) / 3.0;
vec3 gray_color = vec3(grayscale);
float mix_amount = step(threshold, vertical);
color = mix(color, gray_color, mix_amount);
color = mix(color, line_color.rgb, line_amount);
COLOR.rgb = color.rgb;
}```