Scripting HelpersARCHIVE
A little piece of Roblox history. Preserved for everyone, one question at a time.Read about the archive →
COMMUNITY QUESTION

Changing backgroundcolor3 not working?

The html to color3 is working, But i encountered a strange issue where you cant change the color of a frame. Help? (I think it happens because its a localscript)

local Color3 = setmetatable({
	fromInt = function(i)
		return Color3.fromRGB(math.floor((i / 65536) * 256, math.floor(i * 256) * 256, i * 256))
	end
}, {__index = Color3})

HexColorText = script.Parent.Parent.Parent.Color
local Color = HexColorText.Text

HexColorText.Changed:Connect(function()
	local Color = Color3.fromInt(HexColorText.Text)
	print(Color)
	script.Parent.BackgroundColor3 = Color3.fromRGB(Color)
end)

1 answer

The reason I think wasn't working is because color3 isn't compatible with frames instead try using backgroundcolor3.

NOTE: I might be wrong Try the below code

local frame = script.Parent
 
while true do
	for hue = 0, 255, 4 do
		-- HSV = hue, saturation, value
		-- If we loop from 0 to 1 repeatedly, we get a rainbow!
		frame.BorderColor3 = Color3.fromHSV(hue/256, 1, 1)
		frame.BackgroundColor3 = Color3.fromHSV(hue/256, .5, .8)
		wait()
	end
end

2 comments

0

This is not what i wanted.

0

I didnt ask for a rainbow loop!!!!

This discussion is preserved as it was. New answers, comments, and votes are closed.