PcoWSkbVqDnWTu_dm2ix
We use cookies on this site to enhance your user experience
Collapse Sidebar

BackgroundColor3

GuiObject

Color3

BackgroundColor3 determines the color of a UI element’s rectangular background (the fill color). Another property that determines the visual properties of the background is GuiObject/BackgroundTransparency.


Code Samples


Rainbow Frame

This code sample causes a parent Frame to loop through all colors of the rainbow using Color3.fromHSV.

-- Put this code in a LocalScript in a Frame
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