colour.complementary_wavelength¶
-
colour.
complementary_wavelength
(xy, xy_n, cmfs=XYZ_ColourMatchingFunctions(name='CIE 1931 2 Degree Standard Observer', ...))[source]¶ Returns the complementary wavelength \(\lambda_c\) for given colour stimulus \(xy\) and the related \(xy_wl\) first and \(xy_{cw}\) second intersection coordinates with the spectral locus.
In the eventuality where the \(xy_wl\) first intersection coordinates are on the line of purples, the dominant wavelength will be computed in lieu.
The dominant wavelength is indicated by a negative sign and the \(xy_{cw}\) second intersection coordinates which are set by default to the same value than \(xy_wl\) first intersection coordinates will be set to the dominant wavelength intersection coordinates with the spectral locus.
Parameters: - xy (array_like) – Colour stimulus xy chromaticity coordinates.
- xy_n (array_like) – Achromatic stimulus xy chromaticity coordinates.
- cmfs (XYZ_ColourMatchingFunctions, optional) – Standard observer colour matching functions.
Returns: Complementary wavelength, first intersection point xy chromaticity coordinates, second intersection point xy chromaticity coordinates.
Return type: References
Examples
Complementary wavelength computation:
>>> from pprint import pprint >>> xy = np.array([0.35000, 0.25000]) >>> xy_n = np.array([0.31270, 0.32900]) >>> cmfs = CMFS['CIE 1931 2 Degree Standard Observer'] >>> pprint(complementary_wavelength(xy, xy_n, cmfs)) (array(520...), array([ 0.0743553..., 0.8338050...]), array([ 0.0743553..., 0.8338050...]))
Dominant wavelength is returned if the first intersection is located on the line of purples:
>>> xy = np.array([0.26415, 0.37770]) >>> pprint(complementary_wavelength(xy, xy_n, cmfs)) (array(-504...), array([ 0.4897494..., 0.1514035...]), array([ 0.0036969..., 0.6389577...]))