WoWInterface

WoWInterface (https://www.wowinterface.com/forums/index.php)
-   AddOn Help/Support (https://www.wowinterface.com/forums/forumdisplay.php?f=3)
-   -   Kgpanels : keeping a panel gradient & classcolored (https://www.wowinterface.com/forums/showthread.php?t=43593)

Léthalvenom 06-29-12 03:19 AM

Kgpanels : keeping a panel gradient & classcolored
 
I was trying to make some panels gradient while being classcolored. But after a /rl they appear solid again.
Using on load

Code:

local _, class = UnitClass("player")
    local color = (CUSTOM_CLASS_COLORS or RAID_CLASS_COLORS)[class]
    self.bg:SetVertexColor(color.r, color.g, color.b, self.bg:GetAlpha())


jeffy162 06-29-12 11:38 PM

I may be missing something here (and I think everybody would agree that I'm not too good with Lua), but, there doesn't seem to be anything in your code telling the panel to make the color a gradient.

Phanx 06-30-12 02:56 AM

You can either:

1. set your panel's background to use a texture that has a gradient, or

2. set your panel's background to a solid texture and use a different API:

Code:

local _, class = UnitClass("player")
local color = (CUSTOM_CLASS_COLORS or RAID_CLASS_COLORS)[class]
local r, g, b = color.r, color.g, color.b
self.bg:SetGradient("VERTICAL", r, g, b, r / 2, g / 2, b / 2)



All times are GMT -6. The time now is 11:20 PM.

vBulletin © 2020, Jelsoft Enterprises Ltd
© 2004 - 2020 MMOUI