set_default_color_theme()
Set the default color theme for CustomTkinter widgets.Parameters
Either the name of a built-in theme or the path to a custom theme JSON file.Built-in themes:
"blue"- Default blue theme"green"- Green color scheme"dark-blue"- Dark blue variant"sweetkind"- Custom sweetkind color scheme
Behavior
- This function should be called before creating any widgets
- The theme affects widget colors in both light and dark appearance modes
- Built-in themes are loaded from CustomTkinter’s assets directory
- Custom theme files must follow CustomTkinter’s theme JSON structure
Theme File Structure
Custom theme files are JSON files that define colors for different widget types and states. Here’s a basic structure:[light_mode_color, dark_mode_color].
Platform-Specific Values
Themes can specify platform-specific values:Example
Example: Custom Theme
Notes
- The theme defines the default colors; individual widgets can still override colors using their parameters
- Built-in themes are located in
customtkinter/assets/themes/ - Theme changes only affect widgets created after
set_default_color_theme()is called - The theme is separate from the appearance mode (light/dark)
- For a complete theme structure, examine the built-in theme files in the CustomTkinter source code