from_argb method

from_argb

Creates a Color structure from a 32-bit ARGB value.

Returns

The Color structure that this method creates.

def from_argb(self, argb):
    ...
ParameterTypeDescription
argbintA value specifying the 32-bit ARGB value.

from_argb

Creates a Color structure from the specified Color structure, but with the new specified alpha value. Although this method allows a 32-bit value to be passed for the alpha value, the value is limited to 8 bits.

Returns

The Color that this method creates.

def from_argb(self, alpha, base_color):
    ...
ParameterTypeDescription
alphaintThe alpha value for the new Color. Valid values are 0 through 255.
base_colorColorThe Color from which to create the new Color.

Exceptions

ExceptionDescription
ArgumentOutOfRangeExceptionalpha is less than 0 or greater than 255.

from_argb

Creates a Color structure from the specified 8-bit color values (red, green, and blue). The alpha value is implicitly 255 (fully opaque). Although this method allows a 32-bit value to be passed for each color component, the value of each component is limited to 8 bits.

Returns

The Color that this method creates.

def from_argb(self, red, green, blue):
    ...
ParameterTypeDescription
redintThe red component value for the new Color. Valid values are 0 through 255.
greenintThe green component value for the new Color. Valid values are 0 through 255.
blueintThe blue component value for the new Color. Valid values are 0 through 255.

Exceptions

ExceptionDescription
ArgumentOutOfRangeExceptionred, green, or blue is less than 0 or greater than 255.

from_argb

Creates a Color structure from the four ARGB component (alpha, red, green, and blue) values. Although this method allows a 32-bit value to be passed for each component, the value of each component is limited to 8 bits.

Returns

The Color that this method creates.

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

Exceptions

ExceptionDescription
ArgumentOutOfRangeExceptionalpha, red, green, or blue is less than 0 or greater than 255.

See Also