Web Analytics Made Easy - Statcounter
Skip to content

Themes

Themes call reference

Themes give you control over the colors used in all of the windows your program creates. Use sg.theme(name) to set the theme:

sg.theme('Dark Blue 3')

Theme Functions

These will help you get a list of available choices.

theme_list()
theme_previewer()

If you want to get or modify any of the theme settings, there are functions provided to enable you to modify or get the current value of specific theme settings. For example the Button Color or the Input Background Color.

By default the PySimpleGUI color theme is now Dark Blue 3. Gone are the "system default" gray colors. If you want your window to be devoid of all colors so that the system chooses the colors for you, then set the theme to 'gray gray gray'.

There are 159 themes available as of Nov 2022. You can preview these themes by calling theme_previewer() which will create a LARGE window displaying all of the color themes available.

As of Nov 2022, these are your available themes:

image

Theme Names

Theme Name Formula

Themes names that you specify can be "fuzzy". The text does not have to match exactly what you see printed. For example "Dark Blue 3" and "DarkBlue3" and "dark blue 3" all work.

One way to quickly determine the best setting for your window is to simply display your window using a lot of different themes. Add the line of code to set the theme - theme('Dark Green 1'), run your code, see if you like it, if not, change the theme string to 'Dark Green 2' and try again. Repeat until you find something you like.

The "Formula" for the string is:

Dark Color #

or

Light Color #

Color can be Blue, Green, Black, Gray, Purple, Brown, Teal, Red. The # is optional or can be from 1 to XX. Some colors have a lot of choices. There are 13 "Light Brown" choices for example.

Default is Dark Blue 3

image

If you don't set a theme (manually or in the system settings), then the PySimpleGUI default of "Dark Blue 3" will be used.

Theme in System Settings

In the PySimpleGUI System Settings, you can define a default theme that will be applied across all PySimpleGUI programs you make.

"gray gray gray" - No Colors Set

If you want the "OS Default Colors", then you can use the theme "gray gray gray". This tells PySimpleGUI to not set any values, and thus the OS will determine the colors (usually various shades of gray. The legacy names for this were Default 1 or System Default 1

For a "slightly less gray", the original PySimpleGUI color scheme of a blue button and everything else gray then you can get that with the theme Default or System Default.

Make Your Own Theme

You can define your own theme by using the theme_add_new function. See Cookbook or other resources for example use.