Ribbon-like surface, gradient colour along length query

Hi there!

Attached a definition that takes a curve input, offsets the curve on both sides, to create a ribbon-like surface. Now I want to apply a colour gradient to this ribbon, corresponding to the length thereof, using the Gradient component.

Previously I would use the “Custom Materials Preview” component in Human to apply a gradient, the input however is an image file which basically just stretches that image as long as it needs to be to suit the ribbon length. Which works great, for the most part. But you can only stretch it that much before you start seeing weird pixellation, also it’s more tedious to edit the input image when making adjustments on the go. Example below of what I want to achieve.

I find the Gradient component terribly confusing. I know I have to define a range somehow - thought I might do it based on a ribbon length calculation, however I am struggling to figure out how to apply this to the surface.

gradient to surface query.gh (9.7 KB)

does the attached help?
gradient to surface.gh (11.8 KB)

It does, thank you very much!