Need help changing the ImageButton's colour using Color3Value

You can write your topic however you want, but you need to answer these questions:

  1. What do you want to achieve?
    A simple hover-in and out colour of the ImageButton with Color3Value

  2. What is the issue?
    Trying to use a Color3Value and using the ImageButton to change the colour from it.

  3. What solutions have you tried so far? Did you look for solutions on the Developer Hub?
    I tried using Color3.new, none of that worked.

local Home = script.Parent.Parent.Home

for _,v in pairs(Home:GetChildren()) do
	if v:IsA('ImageButton') then
		v.MouseEnter:Connect(function()
			v.ImageColor3 = Color3.fromRGB(v.HoverIn.Value)
		end)
		v.MouseLeave:Connect(function()
			v.ImageColor3 = Color3.fromRGB(v.HoverOut.Value)
		end)
	end
end

Instead of doing this:

v.ImageColor3 = Color3.fromRGB(v.HoverIn.Value)

Try this:

v.ImageColor3 = v.HoverIn.Value

The Color3Value is a Color3, not 3 separate numbers that make up a Color3.

1 Like