I would like to change the colour of my label or text based on the someNumber. For example, if someNumber is lt 20 then the text would display green, if it is more than twenty it would be red. What is the most efficient (and easiest as i'm a lazy programmer) way to go about this?
if someNumber <= 20 then -- If someNumber is less than or equal to 20
STAddonLabelHTD:SetColor(0,1,0,1) -- Set the color to green
else -- If someNumber is anything else (e.g 21 and up)
STAddonLabelHTD:SetColor(1,0,0,1) -- Set the color to red
end
Without checking I believe that should do it.
Last edited by Ak0 : 04/26/14 at 05:13 AM.
Reason: Changed 255 to 1 because I'm dumb :)