Roblox UtilitiesDevlHub Roblox Documentation

Class

StudioTheme

NotCreatableNotReplicated
Inherits
Instance › Object
Memory category
Instances

A collection of colors that make up a Roblox Studio theme, letting a plugin query the color of a Studio UI element for the theme the user currently has active.

A StudioTheme represents one of Roblox Studio's UI color themes, such as the built-in Light and Dark themes, as a palette of colors loaded from the theme's definition. Each color is identified by a StudioStyleGuideColor element (the UI element) together with a StudioStyleGuideModifier (the element's state, which defaults to Default), so a plugin can match its appearance to whichever theme the user currently has active.

Access the currently active theme through Studio.Theme, then call StudioTheme:GetColor() to look up an individual color:

Luau
local theme = settings().Studio.Theme
local color = theme:GetColor(Enum.StudioStyleGuideColor.MainBackground)

Because a user can switch the active theme at any time, listen for Studio.ThemeChanged to refresh your plugin's colors when the theme changes.

Methods 1#

GetColorReturns the color corresponding to the arguments provided.PluginSecurity security

GetColor(styleguideitem: StudioStyleGuideColor, modifier: StudioStyleGuideModifier = Default): Color3#

PluginSecurity security

The GetColor() function returns the Color3 corresponding to the arguments provided. For instance, if you would like to get the Color3 of the Studio "MainButton" when it's disabled, you can use the following code:

Luau
settings().Studio.Theme:GetColor(Enum.StudioStyleGuideColor.MainButton, Enum.StudioStyleGuideModifier.Disabled)

See the StudioStyleGuideColor reference for a list of Studio elements and StudioStyleGuideModifier for a list of modifiers.

NameTypeDefaultDescription
styleguideitemStudioStyleGuideColorThe element you want to get the theme color for.
modifierStudioStyleGuideModifierDefaultThe modifier you want to place on the StyleGuideColor element.
Returns
  • Color3 — The corresponding Color3 theme value.

Inherited members#

Inherited from Instance 58
Inherited from Object 6
Properties (2)

ClassName, className

Events (1)

Changed