Page 1 of 1

Using a Variable to drive a color for a text label

PostPosted: Fri Jan 29, 2016 10:34 pm
by chrisr
Good afternoon all!
OK so here it is, I have entered a new variable we will call it VarColor1. I am placing this variable into this script
WDLabelTextColour,xx,VarColor1 I am not getting any response from this. So first question is CAN I do this. Second is I think maybe I am writing this into the Variable table wrong. I have tried different types of Vars such as string / Double / Integer etc. Also I have tried writing the RGB value with commas and without. Any Ideas? Thanks in Advance!

Cheers

Re: Using a Variable to drive a color for a text label

PostPosted: Fri Jan 29, 2016 11:00 pm
by chrisr
OK... So this is how I went about this. Not sure if this is the only / best way but I got it done.

I wrote three variables, one for each color. R_Var1 / G_Var1 / B_Var1. Totally works if I just place this in for each color value. If there is a better way to accomplish this Im all ears!

Best,

Re: Using a Variable to drive a color for a text label

PostPosted: Mon Feb 01, 2016 4:23 pm
by Thomas Mrozek
Hi Chris,
this is the way you'll have to do it. Only thing you can put in in an array, but you will end up nearly same:
WDLabelTextColour,xx,VarColor[1],VarColor[2],VarColor[3]

cheers
Thomas

Re: Using a Variable to drive a color for a text label

PostPosted: Mon Feb 01, 2016 4:40 pm
by chrisr
Thomas,
Thanks! yes thats what I ended up doing. Works very well thanks. I was just curious if there was a way to do this and have only one variable not three.

Cheers!!

Chris