[docs]classRGB(BaseModel,frozen=True,validate_types=False):"""Represents an RGB color."""r:int"""The red value of the color."""g:int"""The green value of the color."""b:int"""The blue value of the color."""@propertydefas_tuple(self)->tuple[int,int,int]:"""Returns the RGB values as a tuple."""returnself.r,self.g,self.bdef__repr__(self)->str:returnf"rgb{self.as_tuple}"def__iter__(self)->Iterator[int]:returniter(self.as_tuple)defto_dict(self)->dict[Literal["r","g","b"],int]:"""Converts the RGB color to a dictionary."""return{"r":self.r,"g":self.g,"b":self.b}