colour.is_within_visible_spectrum#

colour.is_within_visible_spectrum(XYZ: ArrayLike, cmfs: MultiSpectralDistributions | None = None, illuminant: SpectralDistribution | None = None, tolerance: float = 100 * EPSILON, **kwargs: Any) NDArrayFloat[source]#

Return whether 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 (ArrayLike) – CIE XYZ tristimulus values.

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

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

  • tolerance (float) – Tolerance allowed in the inside-triangle check.

  • kwargs (Any) – {colour.msds_to_XYZ()}, See 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:

numpy.ndarray

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)