Stay organized with collections
Save and categorize content based on your preferences.
blockly > WorkspaceSvg > setTheme
WorkspaceSvg.setTheme() method
Set the workspace theme object. If no theme is passed, default to the Classic
theme.
Signature:
setTheme(theme: Theme): void;
Parameters
Parameter |
Type |
Description |
theme |
Theme |
The workspace theme object. |
Returns:
void
Except as otherwise noted, the content of this page is licensed under the Creative Commons Attribution 4.0 License, and code samples are licensed under the Apache 2.0 License. For details, see the Google Developers Site Policies. Java is a registered trademark of Oracle and/or its affiliates.
Last updated 2024-09-18 UTC.
[[["Easy to understand","easyToUnderstand","thumb-up"],["Solved my problem","solvedMyProblem","thumb-up"],["Other","otherUp","thumb-up"]],[["Missing the information I need","missingTheInformationINeed","thumb-down"],["Too complicated / too many steps","tooComplicatedTooManySteps","thumb-down"],["Out of date","outOfDate","thumb-down"],["Samples / code issue","samplesCodeIssue","thumb-down"],["Other","otherDown","thumb-down"]],["Last updated 2024-09-18 UTC."],[[["\u003cp\u003eThe \u003ccode\u003esetTheme\u003c/code\u003e method allows you to apply a visual theme to the WorkspaceSvg, changing its appearance.\u003c/p\u003e\n"],["\u003cp\u003eIf no theme is provided when calling \u003ccode\u003esetTheme\u003c/code\u003e, the workspace defaults to the \u003ccode\u003eClassic\u003c/code\u003e theme.\u003c/p\u003e\n"],["\u003cp\u003eThis method takes a single argument: a \u003ccode\u003eTheme\u003c/code\u003e object which defines the workspace's visual style.\u003c/p\u003e\n"],["\u003cp\u003eCalling \u003ccode\u003esetTheme\u003c/code\u003e does not return any value, it simply updates the workspace's appearance.\u003c/p\u003e\n"]]],[],null,["[blockly](./blockly.md) \\\u003e [WorkspaceSvg](./blockly.workspacesvg_class.md) \\\u003e [setTheme](./blockly.workspacesvg_class.settheme_1_method.md)\n\nWorkspaceSvg.setTheme() method\n------------------------------\n\nSet the workspace theme object. If no theme is passed, default to the `Classic` theme.\n\n**Signature:** \n\n setTheme(theme: Theme): void;\n\nParameters\n----------\n\n| Parameter | Type | Description |\n|-----------|-----------------------------------|-----------------------------|\n| theme | [Theme](./blockly.theme_class.md) | The workspace theme object. |\n\n**Returns:**\n\nvoid"]]