Thread Tools Display Modes
06-29-12, 03:19 AM   #1
Léthalvenom
A Wyrmkin Dreamwalker
 
Léthalvenom's Avatar
AddOn Author - Click to view addons
Join Date: Oct 2011
Posts: 50
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())
  Reply With Quote
06-29-12, 11:38 PM   #2
jeffy162
A Pyroguard Emberseer
 
jeffy162's Avatar
AddOn Author - Click to view addons
Join Date: May 2009
Posts: 2,364
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.
__________________
Ahhhh, the vagueries of the aging mind. Wait.... What was I saying?


Carbonite <----- GitHub main module (Maps ONLY) download link. The other modules are also available on GitHub.
Carbonite-CLASSIC<----- GitHub link to Carbonite Classic. Thanks to ircdirk for this!
  Reply With Quote
06-30-12, 02:56 AM   #3
Phanx
Cat.
 
Phanx's Avatar
AddOn Author - Click to view addons
Join Date: Mar 2006
Posts: 5,617
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)
__________________
Retired author of too many addons.
Message me if you're interested in taking over one of my addons.
Don’t message me about addon bugs or programming questions.
  Reply With Quote

WoWInterface » AddOns, Compilations, Macros » AddOn Help/Support » Kgpanels : keeping a panel gradient & classcolored


Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

vB code is On
Smilies are On
[IMG] code is On
HTML code is Off