Color constructor
init(self, r=0, g=0, b=0, a=255)
Creates a color from the specified red, green, blue and alpha component values.
def __init__(self, r=0, g=0, b=0, a=255):
...
| Parameter | Type | Description |
|---|
| r | int | The red component value. Valid values are 0 through 255. |
| g | int | The green component value. Valid values are 0 through 255. |
| b | int | The blue component value. Valid values are 0 through 255. |
| a | int | The alpha component value. Valid values are 0 through 255. |
Exceptions
| Exception | Description |
|---|
| ValueError | A component value is less than 0 or greater than 255. |
| TypeError | A component value is not a number. |
See Also