Tried to update the post above with the code but it was too late. Below is the code from our template, for reference:
var FieldName= "CompleteAddress";
var End = [1,1,1,0];
var Start = [15,28,62,0];
var FieldLength = Len(Rule(FieldName));
var StepCyan = (End[0]-Start[0])/FieldLength;
var StepMagenta = (End[1]-Start[1])/FieldLength;
var StepYellow = (End[2]-Start[2])/FieldLength;
var StepBlack = (End[3]-Start[3])/FieldLength;
var myColor;
var Result = "<span>";
// Build Colors for Text
for (c = 0; c < FieldLength; c++)
{
myColor = new FusionProColor("Gradient_01_"+c, Start[0]+(StepCyan*c), Start[1]+(StepMagenta*c), Start[2]+(StepYellow*c), Start[3]+(StepBlack*c));
}
// Build resulting string
for (c = 0; c < FieldLength; c++)
{
if (Asc(Mid(Rule(FieldName), c+1, 1)) == 32)
{
// Special case the space character
Result = Result + " "; // Use " " for a breaking space
}
else if (Asc(Mid(Rule(FieldName), c+1, 1)) == 38)
{
// Special case the ampersand character
Result = Result + "&";
}
else
{
Result = Result + '<color name="Gradient_01_'+c+'">'+Mid(Rule(FieldName), c+1, 1);
}
}
Result = Result + "<\span>";
return Result;