Color
Represents an RGBA color.
Constructor
Represents an RGBA color.
Properties
| Name | Description | Type |
|---|---|---|
r | Red channel value. | int |
g | Green channel value. | int |
b | Blue channel value. | int |
a | Alpha (transparency) 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] |
BLACK | (0, 0, 0, 255) | Color |
WHITE | (255, 255, 255, 255) | Color |
RED | (255, 0, 0, 255) | Color |
GREEN | (0, 255, 0, 255) | Color |
BLUE | (0, 0, 255, 255) | Color |
YELLOW | (255, 255, 0, 255) | Color |
MAGENTA | (255, 0, 255, 255) | Color |
CYAN | (0, 255, 255, 255) | Color |
GRAY | (128, 128, 128, 255) | Color |
DARK_GRAY | (64, 64, 64, 255) | Color |
LIGHT_GRAY | (192, 192, 192, 255) | Color |
ORANGE | (255, 165, 0, 255) | Color |
BROWN | (165, 42, 42, 255) | Color |
PINK | (255, 192, 203, 255) | Color |
PURPLE | (128, 0, 128, 255) | Color |
NAVY | (0, 0, 128, 255) | Color |
TEAL | (0, 128, 128, 255) | Color |
OLIVE | (128, 128, 0, 255) | Color |
MAROON | (128, 0, 0, 255) | Color |
Methods
Copy
copy() → ColorCreate a copy of the color.
Returns
Color : A new Color object with the same RGBA values.