#version 300 es
precision highp float;
uniform vec2 uResolution;
out vec4 outColor;
const float PI = 3.1415926;
float plot(vec2 xy, float fn) {
return smoothstep(fn - 0.005, fn, xy.y) - smoothstep(fn, fn + 0.005, xy.y);
}
vec3 colorA = vec3(0.149,0.141,0.912);
vec3 colorB = vec3(1.000,0.833,0.224);
void main() {
vec2 xy = gl_FragCoord.xy / uResolution.xy;
vec3 fn = vec3(xy.x);
fn.r = smoothstep(0.0, 1.0, xy.x);
fn.g = sin(xy.x * PI);
fn.b = pow(xy.x, 0.5);
vec3 color = mix(colorA, colorB, fn);
color = mix(color, vec3(1.0, 0.0, 0.0), plot(xy, fn.r));
color = mix(color, vec3(0.0, 1.0, 0.0), plot(xy, fn.g));
color = mix(color, vec3(0.0, 0.0, 1.0), plot(xy, fn.b));
outColor = vec4(color, 1.0);
}