from_name method

On this page

from_name

Creates a color from the specified name of a known color.

def from_name(cls, name):
    ...
Parameter Type Description
name str The name of a known color, such as Red or Black.

Returns: Color: The named color.

Raises Description
ValueError name is not a known color name.

See Also

On this page