Changing matrix color formula for image display object

Years ago, Gary helped me come up with a formula for displaying a temperature color in a matrix based on his gradient formulas. I’m having issues updating the color in the matrix when converting the database for Panorama X, so I thought I’d use an image display object instead.

The formula references the matrix row. I’m wondering how I can adapt it for the image display object.

fileglobal vredA1,vredA2,vgreenA1,vgreenA2,vblueA1,vblueA2,
vredAWTU1,vredAWTU2,vgreenAWTU1,vgreenAWTU2,vblueAWTU1,vblueAWTU2,
vredAEFP1,vredAEFP2,vgreenAEFP1,vgreenAEFP2,vblueAEFP1,vblueAEFP2,
vredAETU1,vredAETU2,vgreenAETU1,vgreenAETU2,vblueAETU1,vblueAETU2,
oColorW1,oColorW2,oColorW3,oColorE1,oColorE2,oColorE3,oTemp,vRange,vFormulaWFP,vFormulaWTU,vFormulaEFP,vFormulaETU,vProcessing

oColorW1=htmlrgb(tagparameter(temperatureColors,str(round(RtnArrayGly,1))+“=”,1)[3,-1])
oColorW2=htmlrgb(tagparameter(temperatureColors,str(round(ArrayWestFP,1))+“=”,1)[3,-1])
oColorW3=htmlrgb(tagparameter(temperatureColors,str(round(ArrayWestOUT,1))+“=”,1)[3,-1])
oColorE1=htmlrgb(tagparameter(temperatureColors,str(round(RtnArrayGly,1))+“=”,1)[3,-1])
oColorE2=htmlrgb(tagparameter(temperatureColors,str(round(ArrayEastFP,1))+“=”,1)[3,-1])
oColorE3=htmlrgb(tagparameter(temperatureColors,str(round(ArrayEastOUT,1))+“=”,1)[3,-1])

//[–West FP–]
vredA1=red(oColorW2)
vgreenA1=green(oColorW2)
vblueA1=blue(oColorW2)
vredA2=red(oColorW1)
vgreenA2=green(oColorW1)
vblueA2=blue(oColorW1)

FormulaWFP={“%%”+radixstr(16,(vredA1-(((vredA1-vredA2)/100)(info(“MatrixRow”) -1)))/256)[-2,-1]+
radixstr(16,(vgreenA1-(((vgreenA1-vgreenA2)/100)
(info(“MatrixRow”) -1)))/256)[-2,-1]+
radixstr(16,(vblueA1-(((vblueA1-vblueA2)/100)*(info(“MatrixRow”) -1)))/256)[-2,-1]}

and so on…

Thanks,
Jeff

The way you’ve done it, it’s impossible to update the display.

I would set the Text Display formula to:

"%%"+info("matrixcelldata")

Then I would set up the matrix formula to generate a series of lines, with one hex color per line, something like this:

FF348A
EE2275
...
A80045

Presumably this formula would generate the array based on your input variables, RtnArrayGly, ArrayWestFP, etc. Then if any of these variable values change, you simply use showvariables and the matrix will update.


However, I’m wondering - is the end goal to create a gradient? If so, in Panorama X it would be much easier to do this directly in an Image Display, rather than trying to create a gradient with a matrix. It will be a lot better looking too, and faster.

The intent is to display a single color based on a temperature value that falls on a gradient between blue and bright orange. That formula worked in Panorama 6.

I don’t remember why I used a matrix to begin with, since I only need a colored rectangle. That’s why I thought switching to an image display object was simpler.

On a whim, I changed “info(“MatrixRow”) -1” to 1 and the result of

“%%”+radixstr(16,(vredA1-(((vredA1-vredA2)/100)(1)))/256)[-2,-1]+
radixstr(16,(vgreenA1-(((vgreenA1-vgreenA2)/100)
(1)))/256)[-2,-1]+
radixstr(16,(vblueA1-(((vblueA1-vblueA2)/100)*(1)))/256)[-2,-1]

is %%0100FE, which is the expected blue.

Then, I just had to remove the brackets around the formula so the field contained “%%0100FE” instead of the whole formula and it’s working.

Thanks
Jeff

Glad you figured it out.