Create a truecolor RGB color from a triplet of values. Args: triplet (ColorTriplet): A color triplet containing red, green and blue components. Returns: Color: A new color object.
(cls, triplet: "ColorTriplet")
| 395 | |
| 396 | @classmethod |
| 397 | def from_triplet(cls, triplet: "ColorTriplet") -> "Color": |
| 398 | """Create a truecolor RGB color from a triplet of values. |
| 399 | |
| 400 | Args: |
| 401 | triplet (ColorTriplet): A color triplet containing red, green and blue components. |
| 402 | |
| 403 | Returns: |
| 404 | Color: A new color object. |
| 405 | """ |
| 406 | return cls(name=triplet.hex, type=ColorType.TRUECOLOR, triplet=triplet) |
| 407 | |
| 408 | @classmethod |
| 409 | def from_rgb(cls, red: float, green: float, blue: float) -> "Color": |
no outgoing calls