mirror of
https://github.com/brues-code/pfUI.git
synced 2026-10-07 06:00:00 +00:00
api: trim down color gradient function
* avoid division through zero in unitframes * make use of gradient func in unitframes
This commit is contained in:
+1
-1
@@ -357,7 +357,7 @@ pfUI:RegisterModule("panel", function()
|
||||
repPercent = math.floor(lval / rval * 100)
|
||||
if repPercent < 100 then
|
||||
local link = GetInventoryItemLink("player",id)
|
||||
local r,g,b,hex = GetColorGradient(repPercent/100, 1,0,0, 1,1,0, 0,1,0) -- red to green through yellow
|
||||
local r,g,b,hex = GetColorGradient(repPercent/100)
|
||||
local cPercent = string.format("%s%s%%|r",hex,repPercent)
|
||||
widget.itemLines[table.getn(widget.itemLines)+1]={link, cPercent}
|
||||
end
|
||||
|
||||
Reference in New Issue
Block a user