from_argb method

from_argb(argb)

Creates a color from a 32-bit ARGB value.

Returns

The color created from the specified value.

@staticmethod
def from_argb(argb):
    ...
ParameterTypeDescription
argbintA value specifying the 32-bit ARGB value (signed or unsigned).

Exceptions

ExceptionDescription
ValueErrorA component value is less than 0 or greater than 255.
TypeErrorWrong number or type of arguments.

from_argb(alpha, base_color)

Creates a color from the specified alpha value and base color.

Returns

The color created from the specified values.

@staticmethod
def from_argb(alpha, base_color):
    ...
ParameterTypeDescription
alphaintThe alpha component value. Valid values are 0 through 255.
base_colorColorThe color from which to create the new color.

Exceptions

ExceptionDescription
ValueErrorA component value is less than 0 or greater than 255.
TypeErrorWrong number or type of arguments.

from_argb(red, green, blue)

Creates an opaque color (alpha is 255) from the specified red, green and blue values.

Returns

The color created from the specified values.

@staticmethod
def from_argb(red, green, blue):
    ...
ParameterTypeDescription
redintThe red component value. Valid values are 0 through 255.
greenintThe green component value. Valid values are 0 through 255.
blueintThe blue component value. Valid values are 0 through 255.

Exceptions

ExceptionDescription
ValueErrorA component value is less than 0 or greater than 255.
TypeErrorWrong number or type of arguments.

from_argb(alpha, red, green, blue)

Creates a color from the four ARGB component (alpha, red, green, and blue) values.

Returns

The color created from the specified values.

@staticmethod
def from_argb(alpha, red, green, blue):
    ...
ParameterTypeDescription
alphaintThe alpha component value. Valid values are 0 through 255.
redintThe red component value. Valid values are 0 through 255.
greenintThe green component value. Valid values are 0 through 255.
blueintThe blue component value. Valid values are 0 through 255.

Exceptions

ExceptionDescription
ValueErrorA component value is less than 0 or greater than 255.
TypeErrorWrong number or type of arguments.

See Also