I was able to get the color code to work on the health text but it's changing color when clicking on a target or switching from yellow to green also. I was going to use the same code to change the color for the power text but I'm not any good at lua programming.
Code:
hooksecurefunc("TextStatusBar_UpdateTextStringWithValues",function(statusFrame, _, value, valueMin, valueMax)
local statusFrame = PlayerFrameHealthBarText
if statusFrame and PlayerFrameHealthBarTextLeft and PlayerFrameHealthBarTextRight then
local percent = value / valueMax
local r,g,b = 1,0.82,0 -- yellow
if percent < 0.335 then
r,g,b = 1,0,0 -- red
elseif percent > 0.665 then
r,g,b = 0,1,0 -- green
end
PlayerFrameHealthBarTextLeft:SetTextColor(r,g,b)
PlayerFrameHealthBarTextRight:SetTextColor(r,g,b)
end
end)