@EverthangForeverThe components of gl_Fragcolor vector are
gl_Fragcolor.r the red component - nominally ranges from 0.0 to 1.0
gl_Fragcolor.g the green component - nominally ranges from 0.0 to 1.0
gl_Fragcolor.b the blue component - nominally ranges from 0.0 to 1.0
gl_Fragcolor.a the alpha (opacity) component - nominally ranges from 0.0 to 1.0
they can have values outside of their nominal ranges but this is rare and when they are this is because they are the resut of some calculation. If you want to "normalise" such out of range components use the clamp() function to limit them to the range 0.0 to 1.0.
The length function applied to a vector calculates its length using the normal method you will have been taught at school - i.e. it is the square root of the sum of the squares of the components.
Pure Black will have r,g,b all equal to 0.0 while pure white will have them all equal to 1.0.
So if you want to make the white areas transparent then "invert" each component by subtracting it from 1.0 (optionally after clamping) and then taking the length. i.e. use something like
gl_FragColor.a = length ( vec3(1.0) - gl_FragColor.rgb );