# Path: pytablewriter/_function.py
# def normalize_enum(
#     value, enum_class: Type[Enum], validate: bool = True, default: Optional[Enum] = None
# ):
#     if value is None:
#         return default
# 
#     if isinstance(value, enum_class):
#         return value
# 
#     try:
#         return enum_class[replace_symbol(value.strip(), "_").upper()]
#     except AttributeError:
#         if validate:
#             raise TypeError(f"value must be a {enum_class} or a str: actual={type(value)}")
#     except KeyError:
#         if validate:
#             raise ValueError(
#                 "invalid valid found: expected={}, actual={}".format(
#                     "/".join(item.name for item in enum_class), value
#                 )
#             )
# 
#     return value
# 
# Path: pytablewriter/style/_font.py
# class FontSize(Enum):
#     NONE = "none"
#     TINY = "tiny"
#     SMALL = "small"
#     MEDIUM = "medium"
#     LARGE = "large"
# 
# class FontStyle(Enum):
#     NORMAL = "normal"
#     ITALIC = "italic"
# 
# class FontWeight(Enum):
#     NORMAL = "normal"
#     BOLD = "bold"


from enum import Enum, unique
from typing import Optional, Union, cast
from dataproperty import Align
from tcolorpy import Color
from .._function import normalize_enum
from ._font import FontSize, FontStyle, FontWeight
        return NotImplemented if equal is NotImplemented else not equal

    def update(self, **kwargs) -> None:
        """Update specified style attributes."""
        self.__update_color(initialize=False, **kwargs)
        self.__update_align(initialize=False, **kwargs)
        self.__update_font(initialize=False, **kwargs)
        self.__update_misc(initialize=False, **kwargs)

    def __update_color(self, initialize: bool, **kwargs) -> None:
        fg_color = kwargs.get("color") or kwargs.get("fg_color")
        if fg_color:
            self.__fg_color: Optional[Color] = Color(fg_color)
        elif initialize:
            self.__fg_color = None

        bg_color = kwargs.get("bg_color")
        if bg_color:
            self.__bg_color: Optional[Color] = Color(bg_color)
        elif initialize:
            self.__bg_color = None

    def __update_font(self, initialize: bool, **kwargs) -> None:
        font_size = kwargs.get("font_size")
        if font_size:
            self.__font_size = normalize_enum(
                kwargs.get("font_size"), FontSize, validate=False, default=FontSize.NONE
            )
        elif initialize:
            self.__font_size = FontSize.NONE

# Path: pytablewriter/_function.py
# def normalize_enum(
#     value, enum_class: Type[Enum], validate: bool = True, default: Optional[Enum] = None
# ):
#     if value is None:
#         return default
# 
#     if isinstance(value, enum_class):
#         return value
# 
#     try:
#         return enum_class[replace_symbol(value.strip(), "_").upper()]
#     except AttributeError:
#         if validate:
#             raise TypeError(f"value must be a {enum_class} or a str: actual={type(value)}")
#     except KeyError:
#         if validate:
#             raise ValueError(
#                 "invalid valid found: expected={}, actual={}".format(
#                     "/".join(item.name for item in enum_class), value
#                 )
#             )
# 
#     return value
# 
# Path: pytablewriter/style/_font.py
# class FontSize(Enum):
#     NONE = "none"
#     TINY = "tiny"
#     SMALL = "small"
#     MEDIUM = "medium"
#     LARGE = "large"
# 
# class FontStyle(Enum):
#     NORMAL = "normal"
#     ITALIC = "italic"
# 
# class FontWeight(Enum):
#     NORMAL = "normal"
#     BOLD = "bold"


# Path: pytablewriter/style/_style.py
from enum import Enum, unique
from typing import Optional, Union, cast
from dataproperty import Align
from tcolorpy import Color
from .._function import normalize_enum
from ._font import FontSize, FontStyle, FontWeight

        return NotImplemented if equal is NotImplemented else not equal

    def update(self, **kwargs) -> None:
        """Update specified style attributes."""
        self.__update_color(initialize=False, **kwargs)
        self.__update_align(initialize=False, **kwargs)
        self.__update_font(initialize=False, **kwargs)
        self.__update_misc(initialize=False, **kwargs)

    def __update_color(self, initialize: bool, **kwargs) -> None:
        fg_color = kwargs.get("color") or kwargs.get("fg_color")
        if fg_color:
            self.__fg_color: Optional[Color] = Color(fg_color)
        elif initialize:
            self.__fg_color = None

        bg_color = kwargs.get("bg_color")
        if bg_color:
            self.__bg_color: Optional[Color] = Color(bg_color)
        elif initialize:
            self.__bg_color = None

    def __update_font(self, initialize: bool, **kwargs) -> None:
        font_size = kwargs.get("font_size")
        if font_size:
            self.__font_size = normalize_enum(
                kwargs.get("font_size"), FontSize, validate=False, default=FontSize.NONE
            )
        elif initialize:
            self.__font_size = FontSize.NONE

        self.__validate_attr("font_size", (FontSize, str))