View Single Post
03-17-09, 10:38 AM   #909
Caellian
A Frostmaul Preserver
 
Caellian's Avatar
Join Date: May 2006
Posts: 281
I'm sorry haste but i really don't get how to put this together, the goal being to have the oUF.Tags['[perhp]'](unit) to be gradient colored

Code:
local function Hex(r, g, b)
	if type(r) == "table" then
		if r.r then r, g, b = r.r, r.g, r.b else r, g, b = unpack(r) end
	end

	return string.format("|cff%02x%02x%02x", r*255, g*255, b*255)
end
Code:
oUF.Tags['[perchealth]'] = function(unit) 
		return (UnitHealthMax(unit) > UnitHealth(unit)) and oUF.Tags['[perhp]'](unit) or ''
end
Code:
local min, max = UnitHealth(unit), UnitHealthMax(unit)
return Hex(self.ColorGradient(min/max, 0.69, 0.31, 0.31, 0.65, 0.63, 0.35, 0.33, 0.59, 0.33))
__________________
if (sizeof(workload) > sizeof(brain_capacity)) { die('System Overload'); }