If the player had 50 health, it would be right between green and red, or a shade of yellow
Edit:
You could just have my line of code and set the Color value of the health bar to c whenever the humanoid’s health is changed. I’m not exactly sure that tweening is the right term.
Here’s something I did in one of my games. You don’t have to copy it word for word but it should give you a general idea of what you can do with healthbars.
local bar = script.Parent
local player = game:GetService("Players").LocalPlayer
local humanoid = (player.Character or player.CharacterAdded:Wait()):WaitForChild("Humanoid")
humanoid.HealthChanged:Connect(function()
local hp = math.clamp(humanoid.Health/humanoid.MaxHealth,0,1)
game:GetService("TweenService"):Create(
bar,
TweenInfo.new(
0.1,
Enum.EasingStyle.Quad
),
{
Size = UDim2.new(math.clamp(hp,0,1),0,1,0),
BackgroundColor3 = Color3.fromHSV(hp/3,1,1),
}
):Play()
end)