Skip to content

themeProvider

export type themeProvider = {
    Theme: Value<string>,
    ThemeColors: {[Enum.StudioStyleGuideColor]: {[Enum.StudioStyleGuideModifier]: Value<Color3>}},
    IsDark: Value<boolean>,
    Scope: Scope,
    ItemScope: Scope,
    Fonts: {
        Default: Enum.Font,
        SemiBold: Enum.Font,
        Bold: Enum.Font,
        Black: Enum.Font,
        Mono: Enum.Font,
    },
    GetColor: (self: themeProvider, styleGuideColor: CanBeValue<Enum.StudioStyleGuideColor>, styleGuideModifier: CanBeValue<Enum.StudioStyleGuideModifier>, force: boolean?) -> Computed<Color3>,
    GetFont: (self: themeProvider, fontName: CanBeState<string>) -> Computed<Enum.Font>
}

The type of the themeProvider table that is returned from the themeProvider() function that contains data about the returned themeProvider API.


Properties

Theme : Value<string>

The current theme that is set on the Studio. (Should only be read.)


ThemeColors : {[Enum.StudioStyleGuideColor]: {[Enum.StudioStyleGuideModifier]: Value<Color3>}}

The theme colors used by the components within Plugin Essentials. Directly modifying this table is strongly not recommended, as this table stores all the StudioStyleGuideColors and the StudioStyleGuideModifiers given by the components, and it will most likely cause bugs if overwritten.


IsDark : Value<boolean>

Indicates if the current Studio theme is dark. This is calculated through the background color of the current theme of the Studio. (Should only be read.)


Scope : Scope

The Scope in which the Fusion objects will be created in the themeProvider. (Should only be read.)


ItemScope : Scope

The Scope in which the item objects will be created in the themeProvider. Directly modifying this table is strongly not recommended, as it is used only internally, so modifications to this table will cause bugs.


Fonts : {...: Enum.Font}

The default fonts stored within the themeProvider. (Should only be read.)


GetColor : (self: themeProvider, styleGuideColor: CanBeValue<Enum.StudioStyleGuideColor>, styleGuideModifier: CanBeValue<Enum.StudioStyleGuideModifier>, force: boolean?) -> Computed<Color3>

This function takes in a StudioStyleGuideColor, and a StudioStyleGuideModifier, and using these values, calculates a matching color. This color is returned within a Computed, so when the theme of the Studio updates, or when the ThemeColors table properties are updated, the colors are re-calculated. The colors will also be re-calculated, if the given values are Values, when they are updated.


GetFont : (self: themeProvider, fontName: CanBeState<string>) -> Computed<Enum.Font>

This function will return the matching Font from the Fonts table, with the given fontName parameter. This Font is returned within a Computed, so when the fontName parameter is updated, if it is a State, the Font to be returned will be re-calculated.