Put all of the text button’s in a frame. Then when each of them is clicked you can just take the button’s background color3 and use it to change the color of another GUI.
local frame = --define frame with all the buttons
local FrameToChange =--define UI object here
for i, v in pairs(frame:GetChildren()) do
if v:IsA("TextButton") then
v.Activated:Connect(function()
FrameToChange.BackgroundColor3 = v.BackgroundColor3
end)
end
end
Put an attribute inside every frame color stating which color else you can get the background color etc it is and you can loop through all the colors by doing the following:
local Colors = script.Parent.Colors
for _, color in ipairs(Colors:GetChildren()) do
print(color.Name, color.BackgroundColor3)
end