Page 1 of 1

Hex variable and color

Posted: Mon Jan 08, 2018 5:53 am
by Thundy
Hey all. Another annoying question here.

Im trying to set the color of some text based on the value of a variable but the various permutations of this that i have tried throw exceptions

basically i want to set a variable elsewhere in the code which will allow me to use text color flag i.e

$ textColorVar = "#ffaa00"

text "{color = textColorVar} Text n stuff {/color}"

for clarity i have already tried the above and it doesn't work. it says that color string must be 3,4, 6 or 8 characters long

Re: Hex variable and color

Posted: Mon Jan 08, 2018 6:43 am
by Ocelot
Use string substitution to insert your string into text: text "{color=[textColorVar]} Text n stuff {/color}"

Re: Hex variable and color

Posted: Mon Jan 08, 2018 7:06 am
by Thundy
Thanks Ill give that a try :D