colour.sd_constant#
- colour.sd_constant(k: float, shape: SpectralShape = SPECTRAL_SHAPE_DEFAULT, **kwargs: Any) SpectralDistribution [source]#
Return a spectral distribution of given spectral shape filled with constant \(k\) values.
- Parameters:
k (float) – Constant \(k\) to fill the spectral distribution with.
shape (SpectralShape) – Spectral shape used to create the spectral distribution.
kwargs (Any) – {
colour.SpectralDistribution
}, See the documentation of the previously listed class.
- Returns:
Constant \(k\) filled spectral distribution.
- Return type:
Notes
By default, the spectral distribution will use the shape given by
colour.SPECTRAL_SHAPE_DEFAULT
attribute.
Examples
>>> sd = sd_constant(100) >>> sd.shape SpectralShape(360.0, 780.0, 1.0) >>> sd[400] 100.0