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)