color_to_triple#

color_to_triple(color: str | None = None) tuple[int, int, int][source]#

Given a PIL ImageColor string, return a triple of integers representing the red, green, and blue values.

If color is None, return a random color.

Parameters:

color (str | None) – A PIL ImageColor string

Returns:

An triple of integers

Return type:

tuple[int, int, int]