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):
    ...
ParameterTypeDescription
rintThe red component value. Valid values are 0 through 255.
gintThe green component value. Valid values are 0 through 255.
bintThe blue component value. Valid values are 0 through 255.
aintThe alpha component value. Valid values are 0 through 255.

Exceptions

ExceptionDescription
ValueErrorA component value is less than 0 or greater than 255.
TypeErrorA component value is not a number.

See Also