Perspective Dynamic Button COLOR

I am having a hard time finding out why when i apply an expression to background color element it will change in the preview on property editor but not in the view itself. Expression :

gradient(toStr(tag("[default]" + "Flat Sorter Collector/OUTERBELT SLUG FINDER/GANTRY 1/TRK_FILES/U180400_Gantry_Sensor_2/" + {this.meta.name} +"_")), {[default]Flat Sorter Collector/OUTERBELT SLUG FINDER/GANTRY_LIMIT.value}, {[default]Flat Sorter Collector/OUTERBELT SLUG FINDER/GANTRY_HEIGHT.value}, toColor("orange"), toColor("black"))

This is looking at the name of the of the component and finding the tag and then gradient between the two limits. Like I stated I see the color change in the preview but the buttons color in the view dont change.

Perspective does not use Java colors, which is what your binding is returning. As a result, you’ll see no change. Perspective uses CSS for displaying components, so any returned color needs to be in a CSS-supported format. This limits you to a select subset of formats, including RGB, Hex, and HSL.

Yes i figured that after posting … is there a way to convert to Hex ?? i need the gradient function as the numbers range between 3600 and 0 . i have tried the tohex() with no luck .

Too many ways of doing it. I will take the rgba path.
Just add a script transform

thank you jespinmartin1 for sharing your knowledge it worked perfect.