Gosh that's all kinds of confusing... Let try it using Luatext's... I believe you'll find this runs just a tad bit faster.
Try this for HPColor:
Code:
local curHP, maxHP = HPUnit(unit), MaxHP(unit)
local hpR, hpG, hpB = HPColor(curHP, maxHP)
local hpDif = maxHP - curHP
return "|cff%02x%02x%02x%s", hpR, hpG, hpB, Short(hpDif, true)
Try this power color...
Code:
local powType, maxPow, curPow = UnitPowerType(unit), MaxPower(unit), Power(unit)
local powR, powG, powB = PowerColor(powType)
local powDif = maxPow - curPow
return "|cff%02x%02x%02x%s", powR, powG, powB, Short(powDif, true)