colour.colorimetry.handle_spectral_arguments#

colour.colorimetry.handle_spectral_arguments(cmfs: Optional[colour.colorimetry.spectrum.MultiSpectralDistributions] = None, illuminant: Optional[colour.colorimetry.spectrum.SpectralDistribution] = None, cmfs_default: str = 'CIE 1931 2 Degree Standard Observer', illuminant_default: str = 'D65', shape_default: colour.colorimetry.spectrum.SpectralShape = SPECTRAL_SHAPE_DEFAULT, issue_runtime_warnings: bool = True) Tuple[colour.colorimetry.spectrum.MultiSpectralDistributions, colour.colorimetry.spectrum.SpectralDistribution][source]#

Handle the spectral arguments of various Colour definitions performing spectral computations.

  • If cmfs is not given, one is chosen according to cmfs_default. The returned colour matching functions adopt the spectral shape given by shape_default.

  • If illuminant is not given, one is chosen according to illuminant_default. The returned illuminant adopts the spectral shape of the returned colour matching functions.

  • If illuminant is given, the returned illuminant spectral shape is aligned to that of the returned colour matching functions.

Parameters
Returns

Colour matching functions and illuminant.

Return type

tuple

Examples

>>> cmfs, illuminant = handle_spectral_arguments()
>>> cmfs.name, cmfs.shape, illuminant.name, illuminant.shape
('CIE 1931 2 Degree Standard Observer', SpectralShape(360.0, 780.0, 1.0), 'D65', SpectralShape(360.0, 780.0, 1.0))
>>> cmfs, illuminant = handle_spectral_arguments(
...     shape_default=SpectralShape(400, 700, 20))
>>> cmfs.name, cmfs.shape, illuminant.name, illuminant.shape
('CIE 1931 2 Degree Standard Observer', SpectralShape(400.0, 700.0, 20.0), 'D65', SpectralShape(400.0, 700.0, 20.0))