Web Analytics Made Easy - Statcounter
Skip to content

Themes

Themes documentation

The way to get Windows that have elements that have matching colors.

theme

Sets / Gets the current Theme. If none is specified then returns the current theme. This call replaces the ChangeLookAndFeel / change_look_and_feel call which only sets the theme.

theme(
    new_theme = None
)

Parameter Descriptions

Name Type Default Description
new_theme str None the new theme name to use
RETURN str the currently selected theme

theme_add_new

Add a new theme to the dictionary of themes

theme_add_new(
    new_theme_name,
    new_theme_dict
)

Parameter Descriptions

Name Type Default Description
new_theme_dict dict text to display in element
new_theme_name str text to display in element

theme_background_color

Sets/Returns the background color currently in use Used for Windows and containers (Column, Frame, Tab) and tables

theme_background_color(
    color = None
)

Parameter Descriptions

Name Type Default Description
color str None new background color to use (optional)
RETURN str color string of the background color currently in use

theme_border_width

Sets/Returns the border width currently in use Used by non ttk elements at the moment

theme_border_width(
    border_width = None
)

Parameter Descriptions

Name Type Default Description
RETURN int border width currently in use

theme_button_color

Sets/Returns the button color currently in use

theme_button_color(
    color = None
)

Parameter Descriptions

Name Type Default Description
RETURN (str, str) (str, str) - TUPLE with color strings of the button color currently in use (button text color, button background color)

theme_button_color_background

Returns the button color background currently in use. Note this function simple calls the theme_button_color function and splits apart the tuple

theme_button_color_background()

Parameter Descriptions

Name Type Default Description
RETURN str color string of the button color background currently in use

theme_button_color_text

Returns the button color text currently in use. Note this function simple calls the theme_button_color function and splits apart the tuple

theme_button_color_text()

Parameter Descriptions

Name Type Default Description
RETURN str color string of the button color text currently in use

theme_element_background_color

Sets/Returns the background color currently in use for all elements except containers

theme_element_background_color(
    color = None
)

Parameter Descriptions

Name Type Default Description
RETURN str (str) - color string of the element background color currently in use

theme_element_text_color

Sets/Returns the text color used by elements that have text as part of their display (Tables, Trees and Sliders)

theme_element_text_color(
    color = None
)

Parameter Descriptions

Name Type Default Description
RETURN str color string currently in use

theme_global

Sets / Gets the global PySimpleGUI Theme. If none is specified then returns the global theme from user settings. Note the theme must be a standard, built-in PySimpleGUI theme... not a user-created theme.

theme_global(
    new_theme = None
)

Parameter Descriptions

Name Type Default Description
new_theme str None the new theme name to use
RETURN str the currently selected theme

theme_input_background_color

Sets/Returns the input element background color currently in use

theme_input_background_color(
    color = None
)

Parameter Descriptions

Name Type Default Description
RETURN str (str) - color string of the input element background color currently in use

theme_input_text_color

Sets/Returns the input element entry color (not the text but the thing that's displaying the text)

theme_input_text_color(
    color = None
)

Parameter Descriptions

Name Type Default Description
RETURN str (str) - color string of the input element color currently in use

theme_list

Returns a sorted list of the currently available color themes

theme_list()

Parameter Descriptions

Name Type Default Description
RETURN List[str] A sorted list of the currently available color themes

theme_previewer

Displays a "Quick Reference Window" showing all of the different Look and Feel settings that are available. They are sorted alphabetically. The legacy color names are mixed in, but otherwise they are sorted into Dark and Light halves

theme_previewer(
    columns = 12,
    scrollable = False,
    scroll_area_size = (None, None),
    search_string = None,
    location = (None, None)
)

Parameter Descriptions

Name Type Default Description
columns int 12 The number of themes to display per row
location (int, int) (None, None) Location on the screen to place the window. Defaults to the center like all windows
scroll_area_size (int, int) (None, None) Size of the scrollable area (The Column Element used to make scrollable)
scrollable bool False If True then scrollbars will be added
search_string str None If specified then only themes containing this string will be shown

theme_previewer_swatches

Display themes in a window as color swatches. Click on a color swatch to see the hex value printed on the console. If you hover over a color or right click it you'll also see the hext value.

theme_previewer_swatches()

theme_progress_bar_border_width

Sets/Returns the progress meter border width currently in use

theme_progress_bar_border_width(
    border_width = None
)

Parameter Descriptions

Name Type Default Description
RETURN int border width currently in use for progress meters

theme_progress_bar_color

Sets/Returns the progress bar colors by the current color theme

theme_progress_bar_color(
    color = None
)

Parameter Descriptions

Name Type Default Description
RETURN (str, str) (str, str) - TUPLE with color strings of the ProgressBar color currently in use(button text color, button background color)

theme_slider_border_width

Sets/Returns the slider border width currently in use

theme_slider_border_width(
    border_width = None
)

Parameter Descriptions

Name Type Default Description
RETURN int border width currently in use for sliders

theme_slider_color

Sets/Returns the slider color (used for sliders)

theme_slider_color(
    color = None
)

Parameter Descriptions

Name Type Default Description
RETURN str color string of the slider color currently in use

theme_text_color

Sets/Returns the text color currently in use

theme_text_color(
    color = None
)

Parameter Descriptions

Name Type Default Description
RETURN str (str) - color string of the text color currently in use

theme_text_element_background_color

Sets/Returns the background color for text elements

theme_text_element_background_color(
    color = None
)

Parameter Descriptions

Name Type Default Description
RETURN str (str) - color string of the text background color currently in use

theme_use_custom_titlebar

Returns True if a custom titlebar will be / should be used. The setting is in the Global Settings window and can be overwridden using set_options call

theme_use_custom_titlebar()

Parameter Descriptions

Name Type Default Description
RETURN bool True if a custom titlebar / custom menubar should be used

Old Themes (Look and Feel) - Replaced by theme()

You should NOT use these calls. They are here for your reference should you run into them in existing code.

preview_all_look_and_feel_themes

This method is an alias for theme_previewer

list_of_look_and_feel_values

Get a list of the valid values to pass into your call to change_look_and_feel

list_of_look_and_feel_values()

Parameter Descriptions

Name Type Default Description
RETURN List[str] list of valid string values

change_look_and_feel

Change the "color scheme" of all future PySimpleGUI Windows. The scheme are string names that specify a group of colors. Background colors, text colors, button colors. There are 13 different color settings that are changed at one time using a single call to ChangeLookAndFeel The look and feel table itself has these indexes into the dictionary LOOK_AND_FEEL_TABLE. The original list was (prior to a major rework and renaming)... these names still work... In Nov 2019 a new Theme Formula was devised to make choosing a theme easier: The "Formula" is: ["Dark" or "Light"] Color Number Colors can be Blue Brown Grey Green Purple Red Teal Yellow Black The number will vary for each pair. There are more DarkGrey entries than there are LightYellow for example. Default = The default settings (only button color is different than system default) Default1 = The full system default including the button (everything's gray... how sad... don't be all gray... please....)

change_look_and_feel(
    index,
    force = False
)

Parameter Descriptions

Name Type Default Description
force bool False no longer used
index str the name of the index into the Look and Feel table (does not have to be exact, can be "fuzzy")
RETURN None None