colour.utilities.caching_enable#

class colour.utilities.caching_enable(enable: bool)[source]#

Bases: object

Define a context manager and decorator to temporarily set the Colour caching enabled state.

Parameters:

enable (bool) – Whether to enable or disable Colour caching.

__init__(enable: bool) → None[source]#
Parameters:

enable (bool)

Return type:

None

__enter__() → Self[source]#

Enter the caching context and set the Colour caching state.

Return type:

Self

__exit__(*args: Any) → None[source]#

Exit the caching context manager and restore the previous Colour caching state.

Parameters:

args (Any)

Return type:

None

__call__(function: Callable) → Callable[source]#

Decorate and call the specified function with caching control.

Parameters:

function (Callable)

Return type:

Callable

__weakref__#

list of weak references to the object