Quantcast WoWInterface - View Single Post - need help with some LUA-Texts
View Single Post
10-03-19, 02:42 PM   #5
A Pyroguard Emberseer
SDPhantom's Avatar
AddOn Author - Click to view addons
Join Date: Jul 2006
Posts: 1,920
It's pure Lua code to get a UI color escape from a percentage value. Works fine on the live Lua demo.
I don't know anything about Pitbull4, never used it.

Edit: From the documentation on LuaTexts, this is the conversion from your DogTag3 script.
local cur,max=HP(unit),MaxHP(unit);
local r,g,b=HPColor(cur,max);
return (cur>0 and cur<max) and "|cff%02x%02x%02x%.0f%%|r" or "",r,g,b,100*cur/max;
Edit: Fixed typo; corrected MaxHP()
ESOUI AddOns | WoWInterface AddOns
"All I want is a pretty girl, a decent meal, and the right to shoot lightning at fools."
-Anders (Dragon Age: Origins - Awakening)

Last edited by SDPhantom : 10-05-19 at 02:20 PM.
  Reply With Quote