What Torhal says, Class Colors is the probably the best way to go if you want to avoid taint and still be able to change class colors.
For example like this
Code:
local _, class = UnitClass('player')
local color = CUSTOM_CLASS_COLORS and CUSTOM_CLASS_COLORS[class] or RAID_CLASS_COLORS[class]
whatever:SetColor(color.r, color.g, color.b)
This will also use RAID_CLASS_COLORS, if CUSTOM_CLASS_COLORS through Class Colors are unavailable.