Grandient following the object shape

Hi everybody,

I’m learning unity and I’m very new to shaders. I’m doing a lot of tutorials and already did some things, but I have a problem that I’m not able to solve.
The problem I have is that I want (if it’s possible) to make a gradient (or a texture, material, etc.) follow the object shape. I have a cilinder where I can control the position of the gradient, the spread, etc. But when the object have some curves it fills like this:


But I what that the grandient in this case, takes the shape of the object, filling like this:

It’s that possible? How? Have this a correct name to search for? (I’m sorry, English is not my mother tongue).

This is the current shader graph I’m using:

Thanks in advance, any help is appreciated.

Is there any way to make that? With or without shader graph. I need to be able to fill based on the object shape but cannot find anything like this.