Specifying non-predefined colors in AddLabel

dj45

New member
If I want to color a label with predefined colors in thinkscript, that's easy enough:
Code:
AddLabel(yes, myVar, (if myVar > 2 then Color.GREEN else if myVar > 1 then Color.Yellow else Color.Orange));

But what if I want to specify colors not predefined in thinkscript? Can I specify colors using hex code? I know thinkscript will accept RGB colors using CreateColor, but Color.CreateColor(150, 220, 230) is not valid.

How can I specify non-predefined colors in this AddLabel statement?
 

dj45

New member
Got it. So I do:

Code:
DefineGlobalColor("Global1", CreateColor(0, 128, 0));
AddLabel(yes, myVar, (if myVar > 2 then GlobalColor("Global1") else if myVar > 1 then Color.Yellow else Color.Orange));

Thanks!

Related question - is there a way to specify color by hex code or is RGB color the only way to specify your own color?
 

Similar threads

Top