Class
StudioTheme
NotCreatableNotReplicated
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:
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#
| GetColor | Returns 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:
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.
| Name | Type | Default | Description |
|---|---|---|---|
styleguideitem | StudioStyleGuideColor | The element you want to get the theme color for. | |
modifier | StudioStyleGuideModifier | Default | The modifier you want to place on the StyleGuideColor element. |
Returns
Color3— The corresponding Color3 theme value.
Inherited members#
Inherited from Instance 58
Properties (10)
Archivable, archivable, Capabilities, IsInSandbox, Name, Parent, PredictionMode, RobloxLocked, Sandboxed, UniqueId
Methods (39)
AddTag, children, ClearAllChildren, Clone, clone, Destroy, destroy, FindFirstAncestor, FindFirstAncestorOfClass, FindFirstAncestorWhichIsA, FindFirstChild, findFirstChild, FindFirstChildOfClass, FindFirstChildWhichIsA, FindFirstDescendant, GetActor, GetAttribute, GetAttributeChangedSignal, GetAttributes, GetChildren, getChildren, GetDebugId, GetDescendants, GetFullName, GetStyled, GetStyledPropertyChangedSignal, GetTags, HasTag, IsAncestorOf, IsDescendantOf, isDescendantOf, IsPropertyModified, QueryDescendants, Remove, remove, RemoveTag, ResetPropertyToDefault, SetAttribute, WaitForChild