colour.utilities.filter_warnings

colour.utilities.filter_warnings(state=True, colour_warnings=True, colour_runtime_warnings=False, colour_usage_warnings=False, python_warnings=False)[source]

Filters Colour and also optionally overall Python warnings.

Parameters
  • state (bool, optional) – Warnings filter state.

  • colour_warnings (bool, optional) – Whether to filter Colour warnings, this also filters Colour usage and runtime warnings.

  • colour_runtime_warnings (bool, optional) – Whether to filter Colour runtime warnings.

  • colour_usage_warnings (bool, optional) – Whether to filter Colour usage warnings.

  • python_warnings (bool, optional) – Whether to filter Python warnings.

Returns

Definition success.

Return type

bool

Examples

# Filtering Colour warnings: >>> filter_warnings() True

# Filtering Colour runtime warnings: >>> filter_warnings(colour_warnings=False, colour_runtime_warnings=True) True

# Filtering Colour usage warnings: >>> filter_warnings(colour_warnings=False, colour_usage_warnings=True) True

# Filtering Colour and also Python warnings: >>> filter_warnings(python_warnings=True) True