Color
Represents an RGBA color.
Constructor
-
Color() → Color -
Color(
r: SupportsInt,
g: SupportsInt,
b: SupportsInt,
a: SupportsInt = 255
) → Color -
Color(hex: str) → Color
Represents an RGBA color.
Properties
| Name | Description | Type |
|---|---|---|
BLACK | Color(0, 0, 0, 255) | ClassVar[Color] |
BLUE | Color(0, 0, 255, 255) | ClassVar[Color] |
BROWN | Color(139, 69, 19, 255) | ClassVar[Color] |
CYAN | Color(0, 255, 255, 255) | ClassVar[Color] |
DARK_GRAY | Color(64, 64, 64, 255) | ClassVar[Color] |
DARK_GREY | Color(64, 64, 64, 255) | ClassVar[Color] |
GRAY | Color(128, 128, 128, 255) | ClassVar[Color] |
GREEN | Color(0, 255, 0, 255) | ClassVar[Color] |
GREY | Color(128, 128, 128, 255) | ClassVar[Color] |
LIGHT_GRAY | Color(192, 192, 192, 255) | ClassVar[Color] |
LIGHT_GREY | Color(192, 192, 192, 255) | ClassVar[Color] |
MAGENTA | Color(255, 0, 255, 255) | ClassVar[Color] |
MAROON | Color(128, 0, 0, 255) | ClassVar[Color] |
NAVY | Color(0, 0, 128, 255) | ClassVar[Color] |
OLIVE | Color(128, 128, 0, 255) | ClassVar[Color] |
ORANGE | Color(255, 165, 0, 255) | ClassVar[Color] |
PINK | Color(255, 192, 203, 255) | ClassVar[Color] |
PURPLE | Color(128, 0, 128, 255) | ClassVar[Color] |
RED | Color(255, 0, 0, 255) | ClassVar[Color] |
TEAL | Color(0, 128, 128, 255) | ClassVar[Color] |
WHITE | Color(255, 255, 255, 255) | ClassVar[Color] |
YELLOW | Color(255, 255, 0, 255) | ClassVar[Color] |
a | Alpha (transparency) channel value. | int |
b | Blue channel value. | int |
g | Green channel value. | int |
hex | Get or set the color as a hex string. | str |
hsv | Get or set the color as an HSV tuple. | tuple[float, float, float, float] |
r | Red channel value. | int |
Methods
Copy
copy() → ColorCreate a copy of the color.
Returns
Color : A new Color object with the same RGBA values.