colour.is_within_visible_spectrum

colour.is_within_visible_spectrum(XYZ, cmfs=XYZ_ColourMatchingFunctions(name='CIE 1931 2 Degree Standard Observer', ...), illuminant=SpectralDistribution(name='1 Constant', ...), tolerance=None, **kwargs)[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.

  • 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.

Other Parameters

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

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)