--- title: "system.perspective.setTheme" description: "Changes the theme in a page to the specified theme." --- # system.perspective.setTheme > Changes the theme in a page to the specified theme. This function is used in **Python Scripting**. ## Description Note that this function only changes the theme for a single page, not the entire session. To change the theme for a session, write directly to the `session.theme` property instead. ## Syntax `system.perspective.setTheme(name, [sessionId], [pageId])` ### Parameters Type | Parameter | Description ------- | ------- | ------ String | `name` | The theme name to switch to. Possible values are "dark" or "light". String | `sessionId` | Identifier of the Session to target. If omitted, the current Session will be used automatically. When targeting a different session, then the pageId parameter must be included in the call. [optional] String | `pageId` | Identifier of the page to target. If omitted, the current page will be used automatically. [optional] ### Returns Nothing ### Scope Gateway, Perspective Session :::note This function will only work in the Gateway scope if both `sessionId` and `pageId` are supplied to the call. ::: ## Code Examples ```python title="Code Snippet - Changing Session Theme" # Change the current page's theme to the dark theme. system.perspective.setTheme("dark") ```