It's been years since I worked on a oUF layout, but in this case, I guess it would be as simple as this:
Code:
local oldTarget
local OnSpawnNamePlates = function(self, event, unit)
if (UnitExists('target') and UnitIsUnit('target', unit)) then
if oldTarget then
oldTarget:SetBackdropColor(0, 0, 0, 1)
end
self:SetBackdropColor(1, 1, 1, 1)
oldTarget = self
else
self:SetBackdropColor(0, 0, 0, 1)
end
end
oUF:SpawnNamePlates("mnkNames", OnSpawnNamePlates, cvars)