Colour3Value and UI Colour3 Linking

As a roblox developer, I enjoy the idea of themes when it comes to GUI; as many of us do. Some users (for whatever reason) love the light theme and the majority of us love the dark theme. However, it is currently too hard/tedious to automate the change of a theme, i.e dark to light and vice versa.

I think the transition of themes (selecting themes in a settings GUI) would be easier if you could link an element’s colours to a Color3Value. For example, if I want all the buttons in dark theme to have a dark grey colour - lets say RGB(27,27,27) - but then someone wants to change that to the light theme - lets say RGB(207,207,207) - it’s going to be very tedious to script that. It would be much easier to automate it by setting its colour to a Color3Value; that way, all you have to do is change the Value of said Color3Value and voila voila, they all change simultaneously.

1 Like

Why not create a function and set all the colors with a function?

local Buttons = {...}
local function SetColor(color)
    for _,v in ipairs(Buttons) do
        v.BackgroundColor3 = color
    end
end

This doesn’t seem to be ‘tedious’, and the use case for linking Colors to Color3Values seems reasonably limited.
Alternatively, use Changed to ‘link’ to a Color3Value.

local function Link(Obj,LinkingTo,Property)
    return LinkingTo.Changed:Connect(function(NewValue)
        Obj[Property] = NewValue
    end)
end
1 Like

Again, this is a tedious process. I shouldn’t have to write a function and link it individually just so I can link it to a Color3Value. I just think it would make more sense to be able to link Color3’s to Color3Values; I mean, it’s literally in the name. Just like you can link an object to an ObjectValue, why can you not link a color3 to a Color3Value?

This doesnt make much sense. What is “linking” to an objectvalue? Why can’t you just change the BackgroundColor3 of your frame? You can also use recursion for the function by Halalaluyafail3

2 Likes

I think it would be more tedious and unnecessary for Roblox to have to add “linking” to all other datatypes, Vector3, CFrame, BrickColor, etc. otherwise it would be inconsistent that only one data type is supported. Sometimes you need to make a function to get a certain behaviour. It is neither tedious or unnecessary. It’s just about not being lazy imo. You can also use a module script and the command bar if you wanna do it in one call.

edit; my post is very helpful you just choose not to put any effort, and your use case is very niche so it won’t be added likely

1 Like

How is this tedious? Adding features which can be done with a few lines of code for a small use case seems unnecessary.

Presumably a generic function for something like this would be (Since adding something for every property seems terrible, even for a specific type, and for a specific type it’s inconsistent):
Instance:LinkProperty(ValueBase linkingTo,string property)
Which would function like

local function Link(Obj,LinkingTo,Property)
    return LinkingTo.Changed:Connect(function(NewValue)
        Obj[Property] = NewValue
    end)
end
4 Likes