from_rgb method

from_rgb

Returns a new Color with the requested ged, green, blue values. All color components must be in the range 0-255.

Returns

A new instance of the Color class

def from_rgb(self, red, green, blue):
    ...
ParameterTypeDescription
redbyteA byte that represents the red component of the color.
greenbyteA byte that represents the green component of the color.
bluebyteA byte that represents the blue component of the color.

from_rgb

Returns a new Color with the requested ged, green, blue values. All color components must be in the range 0-255.

Returns

A new instance of the Color class

def from_rgb(self, red, green, blue):
    ...
ParameterTypeDescription
redintA int that represents the red component of the color.
greenintA int that represents the green component of the color.
blueintA int that represents the blue component of the color.

from_rgb

Returns a new Color with the requested ged, green, blue values. All color components must be in the range 0-1.

Returns

A new instance of the Color class

def from_rgb(self, red, green, blue):
    ...
ParameterTypeDescription
redfloatA float that represents the red component of the color.
greenfloatA float that represents the green component of the color.
bluefloatA float that represents the blue component of the color.

See Also