[OUTDATED] Interchangeable GUI themes with ColorScript

Alright, I’ve done it. A easy way to manage GUI “themes” for different color palettes.

There’s some things to note before throwing this into a GUI and expecting it to work, so please don’t skip the instructions.

  1. It’s a ModuleScript, I’d recommend placing straight into StarterGui to be easily accessed as “game.Players.LocalPlayer.StarterGui.ColorScript”

  2. To add your own custom theme names you have to go into the ModuleScript and in the Table called ThemesList add your custom theme. By default, I just put in “Dark” and “Light” (as I will show off that in the short video below).

  3. You can also customize how long the tweening takes to change themes by changing TimeToTween. Also, you’re allowed to change the style of it’s Tween with EasingStyle, if you don’t know what that is just don’t touch it.

  4. Inside your GuiObjects you’ll need the layout as shown here. Sadly you’ll have to this to EVERY GuiObject that changes colors, while this is sad this means you can customize which color becomes what for every single thing for full customization. (Also it’s required that the folder is called “Colors” and that the folders parented to it are named after the property they change.)
    :warning: This can be ignored without erroring but it will also not change the theme of stuff that don’t have the Colors folder. It also only changes Color3s so attempting to change the Size or Position with this will not work.
    image

Before asked, this works for anything that is considered a GuiObject, nothing less, nothing more.
Also as also shown in the short video, you can change multiple properties at once by just adding another folder with the properties name.

How ColorScript is used however is quite easy! Just put it in a location the Client can access, and require it!
ColorScript comes with only one function, SetGui(Instance, Theme).

This is example usage of a button to change the theme to “Dark” (also saying that the ColorScript is in PlayerGui):

local Player = game:GetService("Players").LocalPlayer
local ColorScript = require(Player:WaitForChild("PlayerGui"):WaitForChild("ColorScript"))

script.Parent.MouseButton1Click:Connect(function()
    ColorScript:SetGui(Player.PlayerGui.ScreenGui, "Dark")
end)

This sets everything inside of a specific location to that theme! The reason for why it only sets it in one specific GUI is because there might be GUIs in your game that you don’t want the colors changeable and/or you have multiple themes throughout your GUIs.

Alright, well that’s how to use it! I really doubt I missed anything, so here’s the ModuleScript!
Enjoy using it and please tell me how you like it!
ColorScript.rbxm (1.5 KB)

(PS: I didn’t really know what to name this, I think it’s named correctly however, correct me if I’m wrong.)

10 Likes

What about Gui objects with multiple color properties? Do I have to create a new folder instance named after the property and child it to the colors folder? e.g. TextLabel has TextColor3, TextStrokeColor3, BackgroundColor3, etc. Also, what about non-color properties like TextStrokeTransparency?

Why not use CollectionService for easier management and avoid folders / value instances all together?

Regardless of my questions, this is till a cool idea! :octopus:

1 Like

I actually didn’t even know CollectionService existed… I’ll look into it!
It only modifies Color3 properties, I don’t know if I plan on changing it but I’ll think about it. (Or if you want you can remove where it asks if it’s type is Color3Value). Also yeah, at the moment I have it set so if you wanted multiple values to change you could do that too!
image

1 Like

Can you upload it to a roblox module so we can

require()

it?

Just download the file provided and put it in your game. It’s bad practice to require by ID, anyway.

1 Like

It really does look good, nice script.

1 Like