colour.is_within_visible_spectrum

colour.is_within_visible_spectrum(XYZ, interval=10, cmfs=XYZ_ColourMatchingFunctions(name='CIE 1931 2 Degree Standard Observer', ...), illuminant=SpectralDistribution(name='1 Constant', ...), tolerance=None)[source]

Returns if given CIE XYZ tristimulus values are within visible spectrum volume / given colour matching functions volume.

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

  • interval (int, optional) – Wavelength \(\lambda_{i}\) range interval used to compute the pulse waves for the CIE XYZ colourspace outer surface.

  • cmfs (XYZ_ColourMatchingFunctions, optional) – Standard observer colour matching functions.

  • illuminant (SpectralDistribution, optional) – Illuminant spectral distribution.

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

Returns

Is within visible spectrum.

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)