With a use of variable "event" is possible to avoid unnecessary getPlayerColors(unit) calls.
What's the reason for UpdateColor:RegisterEvent("UNIT_FACTION")?
For me it feels that
Lua Code:
PlayerHitIndicator:SetText(nil)
PlayerHitIndicator.SetText = function() end
is a wrong way to hide text due to tainting.