Skip to content
Related Articles

Related Articles

Improve Article

Adding Customized Color Theme in PySimpleGUI

  • Last Updated : 05 Aug, 2020

PySimpleGUI allows users to choose Themes for its Theme list. Also, it allows users to specify and customize the Theme according to their choice. The User only should know the Color shades i.e the hex codes of the Colors. Accordingly, he/she can customize the Theme by new Colors.

Example:




import PySimpleGUI as sg
  
# Add your new theme colors and settings
sg.LOOK_AND_FEEL_TABLE['MyCreatedTheme'] = {'BACKGROUND': '# 000066',
                                        'TEXT': '# FFCC66',
                                        'INPUT': '# 339966',
                                        'TEXT_INPUT': '# 000000',
                                        'SCROLL': '# 99CC99',
                                        'BUTTON': ('# 003333', '# FFCC66'),
                                        'PROGRESS': ('# D1826B', '# CC8019'),
                                        'BORDER': 1, 'SLIDER_DEPTH': 0
'PROGRESS_DEPTH': 0, }
  
# Switch to use your newly created theme
sg.theme('MyCreatedTheme')
  
# Call a popup to show what the theme looks like
sg.popup_get_text('This how the MyNewTheme is created')      

Output:

 Attention geek! Strengthen your foundations with the Python Programming Foundation Course and learn the basics.  

To begin with, your interview preparations Enhance your Data Structures concepts with the Python DS Course. And to begin with your Machine Learning Journey, join the Machine Learning – Basic Level Course

My Personal Notes arrow_drop_up
Recommended Articles
Page :