# Path: pysubs2/common.py
# class Color:
#     """
#     8-bit RGB color with alpha channel.
# 
#     All values are ints from 0 to 255.
#     """
#     r: int
#     g: int
#     b: int
#     a: int = 0
# 
#     def __init__(self, r: int, g: int, b: int, a: int = 0):
#         for value in r, g, b, a:
#             if value not in range(256):
#                 raise ValueError("Color channels must have values 0-255")
# 
#         self.r = r
#         self.g = g
#         self.b = b
#         self.a = a


import warnings
import dataclasses
from typing import Dict, Any, ClassVar
from .common import Color


@dataclasses.dataclass(repr=False)
class SSAStyle:
    """
    A SubStation Style.

    In SubStation, each subtitle (:class:`SSAEvent`) is associated with a style which defines its font, color, etc.
    Like a subtitle event, a style also consists of "fields"; see :attr:`SSAStyle.FIELDS` for a list
    (note the spelling, which is different from SubStation proper).

    Subtitles and styles are connected via an :class:`SSAFile` they belong to. :attr:`SSAEvent.style` is a string
    which is (or should be) a key in the :attr:`SSAFile.styles` dict. Note that style name is stored separately;
    a given :class:`SSAStyle` instance has no particular name itself.

    This class defines equality (equality of all fields).

    """
    DEFAULT_STYLE: ClassVar["SSAStyle"] = None  # type: ignore[assignment]

    @property
    def FIELDS(self):
        """All fields in SSAStyle."""
        warnings.warn("Deprecated in 1.2.0 - it's a dataclass now", DeprecationWarning)
        return frozenset(field.name for field in dataclasses.fields(self))

    fontname: str = "Arial"  #: Font name
    fontsize: float = 20.0  #: Font size (in pixels)

# Path: pysubs2/common.py
# class Color:
#     """
#     8-bit RGB color with alpha channel.
# 
#     All values are ints from 0 to 255.
#     """
#     r: int
#     g: int
#     b: int
#     a: int = 0
# 
#     def __init__(self, r: int, g: int, b: int, a: int = 0):
#         for value in r, g, b, a:
#             if value not in range(256):
#                 raise ValueError("Color channels must have values 0-255")
# 
#         self.r = r
#         self.g = g
#         self.b = b
#         self.a = a


# Path: pysubs2/ssastyle.py
import warnings
import dataclasses
from typing import Dict, Any, ClassVar
from .common import Color



@dataclasses.dataclass(repr=False)
class SSAStyle:
    """
    A SubStation Style.

    In SubStation, each subtitle (:class:`SSAEvent`) is associated with a style which defines its font, color, etc.
    Like a subtitle event, a style also consists of "fields"; see :attr:`SSAStyle.FIELDS` for a list
    (note the spelling, which is different from SubStation proper).

    Subtitles and styles are connected via an :class:`SSAFile` they belong to. :attr:`SSAEvent.style` is a string
    which is (or should be) a key in the :attr:`SSAFile.styles` dict. Note that style name is stored separately;
    a given :class:`SSAStyle` instance has no particular name itself.

    This class defines equality (equality of all fields).

    """
    DEFAULT_STYLE: ClassVar["SSAStyle"] = None  # type: ignore[assignment]

    @property
    def FIELDS(self):
        """All fields in SSAStyle."""
        warnings.warn("Deprecated in 1.2.0 - it's a dataclass now", DeprecationWarning)
        return frozenset(field.name for field in dataclasses.fields(self))

    fontname: str = "Arial"  #: Font name
    fontsize: float = 20.0  #: Font size (in pixels)

    primarycolor: Color = Color(255, 255, 255, 0)  #: Primary color (:class:`pysubs2.Color` instance)