Or for threat colored text.
Code:
function(unit)
local _, _, threatpct, _, threatvalue = UnitDetailedThreatSituation(unit, "target")
local color = status and {GetThreatStatusColor(status)} or {GetThreatStatusColor(0)}
if threatvalue then
return "|cff%02x%02x%02x%d|r", color[1], color[2], color[3], floor(threatpct)
else
return ""
end
end