colour.xy_to_xyY¶
-
colour.
xy_to_xyY
(xy, Y=1)[source]¶ Converts from xy chromaticity coordinates to CIE xyY colourspace by extending the array last dimension with \(Y\) Luminance.
xy
argument with last dimension being equal to 3 will be assumed to be a CIE xyY colourspace array argument and will be returned directly by the definition.Parameters: - xy (array_like) – xy chromaticity coordinates or CIE xyY colourspace array.
- Y (numeric, optional) – Optional \(Y\) Luminance value used to construct the CIE xyY colourspace array, otherwise the \(Y\) Luminance will be set to 1.
Returns: CIE xyY colourspace array.
Return type: ndarray
Notes
- This definition is a convenient object provided to implement support of
illuminant argument luminance value in various
colour.models
package objects such ascolour.Lab_to_XYZ()
orcolour.Luv_to_XYZ()
. - Input xy chromaticity coordinates are in domain [0, 1].
- Output CIE xyY colourspace array is in range [0, 1].
References
Examples
>>> xy = np.array([0.26414772, 0.37770001]) >>> xy_to_xyY(xy) array([ 0.2641477..., 0.3777000..., 1. ]) >>> xy = np.array([0.26414772, 0.37770001, 0.10080000]) >>> xy_to_xyY(xy) array([ 0.2641477..., 0.3777000..., 0.1008...]) >>> xy = np.array([0.26414772, 0.37770001]) >>> xy_to_xyY(xy, 100) array([ 0.2641477..., 0.3777000..., 100. ])