colour.is_within_visible_spectrum

colour.is_within_visible_spectrum(XYZ, cmfs=None, illuminant=None, tolerance=None, **kwargs)[source]

Returns if given CIE XYZ tristimulus values are within the visible spectrum volume, i.e. Rösch-MacAdam colour solid, for given colour matching functions and illuminant.

Parameters
  • XYZ (array_like) – CIE XYZ tristimulus values.

  • cmfs (XYZ_ColourMatchingFunctions, optional) – Standard observer colour matching functions, default to the CIE 1931 2 Degree Standard Observer.

  • illuminant (SpectralDistribution, optional) – Illuminant spectral distribution, default to CIE Illuminant E.

  • tolerance (numeric, optional) – Tolerance allowed in the inside-triangle check.

  • **kwargs (dict, optional) – {colour.msds_to_XYZ()}, Please refer to the documentation of the previously listed definition.

Returns

Are CIE XYZ tristimulus values within the visible spectrum volume, i.e. Rösch-MacAdam colour solid.

Return type

bool

Notes

Domain

Scale - Reference

Scale - 1

XYZ

[0, 1]

[0, 1]

Examples

>>> import numpy as np
>>> is_within_visible_spectrum(np.array([0.3205, 0.4131, 0.51]))
array(True, dtype=bool)
>>> a = np.array([[0.3205, 0.4131, 0.51],
...               [-0.0005, 0.0031, 0.001]])
>>> is_within_visible_spectrum(a)
array([ True, False], dtype=bool)