ColorCycler¶

class ColorCycler(colors=None)[source]¶

Class to cycle through a list of colors.

Initialise the color cycler.

Methods

generate_random

Generate a new random color.

get_next

Get the next color in the list.

get_random

Get a random color from the list.

Parameters:

colors (list[str] | None)

static generate_random()[source]¶

Generate a new random color.

Return type:

str

get_next()[source]¶

Get the next color in the list.

Parameters:

self (ColorCycler)

Return type:

str

get_random()[source]¶

Get a random color from the list.

Parameters:

self (ColorCycler)

Return type:

str