You will most likely have to use secure hooks. For an example,
here is the function I use in !ClassColors to apply custom class colors to the health bars of the default raid frames:
lua Code:
hooksecurefunc("CompactUnitFrame_UpdateHealthColor", function(frame)
if frame.optionTable.useClassColors and UnitIsConnected(frame.unit) then
local _, class = UnitClass(frame.unit)
if class then
local color = CUSTOM_CLASS_COLORS[class]
if color then
frame.healthBar:SetStatusBarColor(color.r, color.g, color.b)
end
end
end
end)
You'll need to change the function, object, and table names, but otherwise it should be pretty similar. You can't modify the original table at all, so you'll need to add a bunch more hooks to apply your custom colors to power bars in other parts of the UI as well.