CustomTkinter/customtkinter/widgets/core_widget_classes/appearance_mode_base_class.py

16 lines
547 B
Python
Raw Normal View History

from typing import Union, Tuple, List
class CTkAppearanceModeBaseClass:
def __init__(self):
def _apply_appearance_mode(self, color: Union[str, Tuple[str, str], List[str]]) -> str:
""" color can be either a single hex color string or a color name or it can be a
tuple color with (light_color, dark_color). The functions returns
always a single color string """
if type(color) == tuple or type(color) == list:
return color[self._appearance_mode]
else:
return color