Like this?
Code:
local function eventHandler(self, event, ...)
if UnitIsPlayer("target") then
local if then c = RAID_CLASS_COLORS[select(2, UnitClass("target"))] end
TargetFrameNameBackground:SetVertexColor(c.r, c.g, c.b)
end
if UnitIsPlayer("focus") then
local if then c = RAID_CLASS_COLORS[select(2, UnitClass("focus"))] end
FocusFrameNameBackground:SetVertexColor(c.r, c.g, c.b)
end
end