I need to get the albedo information of a color gradient from line2d how can I do it please help me. The only information I found was that in version 3.5 shader type canvas_item had a built-in variable vec4 MODULATE, which disappeared from the documentation for 4.x version.
In the vertex() function, COLOR contains the color from the vertex primitive multiplied by the CanvasItem’s modulate multiplied by the CanvasItem’s self_modulate
This means that at the input to the vertex() function the COLOR value, very roughly speaking contains the total modulate value we need (total because of the modulate*self_modulate multiplication and other transformations). We only have to write it into a variable and do the necessary work with it. But you must remember that these are the vertex color values and not modulation, with all the advantages and disadvantages that come with it.
For me, the 2nd method turned out to be the best since I needed to extract the gradient data from line2d I hope I helped a wandering newbie like me in writing his first shaders.