From what I remember, an issue with GLES2 is that it doesn't have HDR support, so values above 1 are just rendered as white. If you add rainbow = normalize(rainbow);
before COLOR = vec4(rainbow, 2.0 * (0.5 - tail_center));
then the rainbow will still have color, though the colors will be muted.
As @cybereality mentioned and what I have found on the documentation, the issue is that GLES2 uses an sRGB color space instead of a linear color space. I tried using OUTPUT_IS_SRGB
but it was not working for me.