View Single Post
03-17-09, 11:27 AM   #913
Jabar
Premium Member
 
Jabar's Avatar
Premium Member
AddOn Author - Click to view addons
Join Date: Jan 2008
Posts: 8
Originally Posted by Caellian View Post
If it has to be something like this which look quite weird to me:

Code:
oUF.Tags['[perchealth]'] = function(unit) 
	local min, max = UnitHealth(unit), UnitHealthMax(unit)
	if UnitHealthMax(unit) > UnitHealth(unit) then
		return Hex(self.ColorGradient(min/max, 0.69, 0.31, 0.31, 0.65, 0.63, 0.35, 0.33, 0.59, 0.33))..oUF.Tags['[perhp]'](unit)
	end
end
Then

Code:
oUF_cTags.lua:33: attempt to index global 'self' (a nil value)
But i guess that's not how it's supposed to be.
This error occurs because you shouldn't use self.ColorGradient inside a Tag but oUF.ColorGradient .

Edit: haste owned me