colour.algebra.set_sdiv_mode#

colour.algebra.set_sdiv_mode(mode: Literal['Numpy', 'Ignore', 'Warning', 'Raise', 'Ignore Zero Conversion', 'Warning Zero Conversion', 'Ignore Limit Conversion', 'Warning Limit Conversion'] | str)[source]#

Set Colour safe division function mode.

Parameters:

mode (Literal['Numpy', 'Ignore', 'Warning', 'Raise', 'Ignore Zero Conversion', 'Warning Zero Conversion', 'Ignore Limit Conversion', 'Warning Limit Conversion'] | str) – Colour safe division mode, see colour.algebra.sdiv() definition for an explanation about the possible modes.

Examples

>>> with sdiv_mode(get_sdiv_mode()):
...     print(get_sdiv_mode())
...     set_sdiv_mode("Raise")
...     print(get_sdiv_mode())
ignore zero conversion
raise