I’ve found that you can set a gradient as a property in a shader and sample it for a color using the sample gradient node, but I cannot find info on how to set the value of the gradient property from a C# script.
It would be helpful to know how to do this directly to a material (i.e. “material.SetGradient”) and for a MaterialPropertyBlock.
Gradients are not a supported material property, that implementation is specific to Shader Graph. The intent of it being on the blackboard is to re-use the same gradient in multiple places, but the material doesn’t support it as a property, limitation of Shader Lab.
I guess the closest thing would be creating a texture containing the gradient and using that instead.
However I am dishartened as well to hear that it is not posible otherwise.